# Individual PDFs via Toad Data Report

**URL:** <https://forums.toadworld.com/t/individual-pdfs-via-toad-data-report/26918>\
**Category:** Toad Data Point & Toad Intelligence Central\
**Created:** [September 30, 2013, 8:53am UTC](https://forums.toadworld.com/t/individual-pdfs-via-toad-data-report/26918 "2013-09-30T08:53:26Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![TDP\_OWL](https://avatars.discourse-cdn.com/v4/letter/t/ce73a5/32.png) [@TDP\_OWL](https://forums.toadworld.com/u/TDP_OWL)\
**Post date:** [September 30, 2013, 8:53am UTC](https://forums.toadworld.com/t/individual-pdfs-via-toad-data-report/26918/1 "2013-09-30T08:53:26Z")

</div>

Hey all.

I am trying to generate individual PDF for each user id via Toad Data Report. To loop through the records, I use the loop activity. Here is how it is setup:

![tdr loop.png](https://global.discourse-cdn.com/quest/original/2X/6/621dc9a58e20a68cdcf81a1e497da0189eec98a2.png)

I have a bind variable in the SQL in the TDR file equal to user id from Loop\_data\_1. However, individual PDFs are created, but each PDF contains all records.

Am I missing a step?

---

<div class="post-metadata">

**Author:** ![TDP\_OWL](https://avatars.discourse-cdn.com/v4/letter/t/ce73a5/32.png) [@TDP\_OWL](https://forums.toadworld.com/u/TDP_OWL)\
**Post date:** [September 30, 2013, 9:15am UTC](https://forums.toadworld.com/t/individual-pdfs-via-toad-data-report/26918/2 "2013-09-30T09:15:06Z")

</div>

Update: I learned that my TDR file did not save the SQL update after I added the

WHERE TBL1.TBL1\_ID = ‘#Loop\_data\_1\_SQL.TBL1\_ID#’

This is very strange. I even did SAVE AS.

So, now my TDR file has this dind variable, but the Automation script prompts with a dialog box to enter the value for ‘#Loop\_data\_1\_SQL.TBL1\_ID#’

---

<div class="post-metadata">

**Author:** ![IgorM](https://sea1.discourse-cdn.com/quest/user_avatar/forums.toadworld.com/igorm/32/116_2.png) [@IgorM](https://forums.toadworld.com/u/IgorM)\
**Post date:** [September 30, 2013, 9:17am UTC](https://forums.toadworld.com/t/individual-pdfs-via-toad-data-report/26918/3 "2013-09-30T09:17:44Z")

</div>

Hi,

It should work if the SQL in Loop\_data\_1 returns the single column containing user IDs and the SQL in data report uses :BindVarName form of bind var referencing (notice the using of a colon).

To make sure there is no bug in here, reviewing your failed script might be of a great help.

Thanks,

Igor.

---

<div class="post-metadata">

**Author:** ![TDP\_OWL](https://avatars.discourse-cdn.com/v4/letter/t/ce73a5/32.png) [@TDP\_OWL](https://forums.toadworld.com/u/TDP_OWL)\
**Post date:** [September 30, 2013, 10:26am UTC](https://forums.toadworld.com/t/individual-pdfs-via-toad-data-report/26918/4 "2013-09-30T10:26:08Z")

</div>

Loop\_data\_1 returns 98 records. I want to generate one PDF per record.

Do I have to have Set Variable and/or Set Variable Value activities in the Automation script?

---

<div class="post-metadata">

**Author:** ![TDP\_OWL](https://avatars.discourse-cdn.com/v4/letter/t/ce73a5/32.png) [@TDP\_OWL](https://forums.toadworld.com/u/TDP_OWL)\
**Post date:** [September 30, 2013, 12:43pm UTC](https://forums.toadworld.com/t/individual-pdfs-via-toad-data-report/26918/5 "2013-09-30T12:43:22Z")

</div>

I figured this out. Here is what the automation looks like:

![8030.Capture.png](https://global.discourse-cdn.com/quest/original/2X/6/6149957e69ed4016c66fb394e2b96fe4c657983a.png)

1. In Set\_Variable\_1: Set variable name - v\_id

2. Insert the full query in Loop\_data\_1

3. In Set\_Variable\_Value\_1: set v\_id = #Loop\_data\_1\_SQL.TBL1\_ID#

4. In TDR SQL where clause: Where tbl1.tbl1\_id = :v\_id

---

<div class="post-metadata">

**Author:** ![IgorM](https://sea1.discourse-cdn.com/quest/user_avatar/forums.toadworld.com/igorm/32/116_2.png) [@IgorM](https://forums.toadworld.com/u/IgorM)\
**Post date:** [September 30, 2013, 12:48pm UTC](https://forums.toadworld.com/t/individual-pdfs-via-toad-data-report/26918/6 "2013-09-30T12:48:56Z")

</div>

Glad to hear you’ve solved the problem.

Igor.
