Jump to content
Sign in to follow this  
gardenlevel

Breaking report in to multiple pages

Recommended Posts

I have script that runs a grouped data report that is sorted into a page for each customer. Each customer has one or more items assigned to them. The script then enters preview mode. So the report is 10 pages if there are 10 customers. I want to create a PDF of each individual page, not the whole report and not a single record. I want the name of the PDF to be the name of the customer. Can I do this?

Share this post


Link to post
Share on other sites

Yes you can do this but you will probably need to run the report once for each customer. A loop takes care of that. To specify the name you'll need to construct the full path in a variable and then use that as the output path. E.g.:

Set Variable( $path ; Get(DesktopPath) & customer & ".pdf" )

Save records as PDF( $path )

Share this post


Link to post
Share on other sites

My issue with that is I have over 1500 customers, but only a handful have items assigned to them. Do I have to cycle through each customer, and if so how do I stop the script form generating a pop-up each time a customer has no found items?

Share this post


Link to post
Share on other sites

One approach would be to first do the search you're currently doing to isolate those 10 customers as in your first example. You could then loop through that found set and generate a PDF for each one.

That would make your last question moot, but FYI if you're talking about suppressing error dialogs, all you have to do is turn error capture on in the script.

Share this post


Link to post
Share on other sites

Set Variable( $path ; Get(DesktopPath) & customer & ".pdf" )

Save records as PDF( $path )

Hi...I'm writing to you because I need to understand this loop you described. I don't know how to translate the variables into actual information from my database to create this loop. Actually, I believe I understand the second line, but I can't construct the first line.

I have a 4-page report that is run for 30 specific companies and is driven by the field Symbol to select these companies. Within my script that creates a single PDF with all 120 pages, I have a Perform Script command that does the find to extract these 30 symbols. What I want to be able to do is generate page numbers (1 through 4) for each set of reports. It seems this loop should do that for me, but I need to understand how to construct it.

I have attached the script I use to PDF these reports so you know what I'm doing right now. There are no page numbers in the report itself at the moment, because to do so without the loop just numbers the resulting 120 pages consecutively.

If you could help that would be great.

Debbie

PDF_All_CHSS_Reports_Script.pdf

Share this post


Link to post
Share on other sites

You have this line in your script:

Save Records as PDF( File Name: "filewin:/K:/PDFs/IIVA DB/CHSS Reports.pdf"; Automatically open; Records being browsed )

If you want to save a report with the customer name, then you could do it like this:

Set Variable( $path ; "filewin:/K:/PDFs/IIVA DB/" & customerNameField & ".pdf" )

Questions: You said earlier there's a page for each customer - does that mean one record per customer? Is the layout for this report based on customers?

Is making separate PDFs even your goal anymore? In your recent post you say there's 4 pages per company and you want to renumber them. Seems like a different question.

If your records are summarized by customer, you can insert a subsummary part and use the "Restart page numbers after each occurrence" checkbox.

Share this post


Link to post
Share on other sites

Questions: You said earlier there's a page for each customer - does that mean one record per customer? Is the layout for this report based on customers?

Actually, I didn't say that I had "a page" for each customer. This is what I said:

I have a 4-page report that is run for 30 specific companies...

Regarding this statement...

Is making separate PDFs even your goal anymore? In your recent post you say there's 4 pages per company and you want to renumber them. Seems like a different question.

I didn't say this either. This is what I said...

What I want to be able to do is generate page numbers (1 through 4) for each set of reports. It seems this loop should do that for me, but I need to understand how to construct it.

I realize that I can create one PDF file per Symbol and not have a page numbering problem. My issue comes with trying to number each set of 4 pages within a single PDF containing all 120 pages (30 symbols x 4 pages). I don't want a separate PDF file for each symbol. It's too cumbersome to deal with so many individual files. Also, the specific list of Symbols changes. That's why there is a separate script that performs the find on Symbol. I use this one Find script over and over throughout the many reports I have, because I only want to have to change that list in one place.

I don't summarize by symbol, so I cannot use the function you mentioned. This is just a straightforward report that displays data for a specific list of symbols. It's a single layout with each page being delineated within the layout. There is only one record per Symbol (company). I simply do a find and display to a 4-page layout.

Bottom line...my only question is how to get page numbers 1 thru 4 on each set of reports in a single PDF containing 30 reports (120 pages). Hopefully, I have clarified things and not confused them more.

Thanks for responding...I appreciate it very much.

Share this post


Link to post
Share on other sites

See, that's what comes from hijacking a thread. Anyway, it seems the solution is simple: in Layout mode, double-click the Body part, and set it to restart page numbers after each occurrence.

Share this post


Link to post
Share on other sites

I don't understand...I hijacked a thread?? I was asking a legitimate question about a previous post. I was asking you what you meant in your response...to translate the language. I can't help if you didn't realize that you weren't talking to "Newbie", and I'm sorry if I did something that isn't "legal" in a forum. Silly me for thinking I could ask for clarification in what I thought was a post that was related to a similar problem I was having.

I do appreciate your solution, though, and I'm very sorry if I did something wrong in obtaining it. I thought the whole idea about searching forums for similar problems, looking for solutions, and keeping the posts together was how it all worked. I'm just so new at this, I guess I overstepped and did something I wasn't supposed to...sorry.

Thanks again. I'll try not to let this happen in the future. One day I'll get the hang of this whole forum thing. :sorrysign: and :thankyou:

Share this post


Link to post
Share on other sites

Take it easy - no one was injured and no harm was done. It's just that we tend to read quickly and look for the details that really matter. It took me a while to realize that you weren't the original poster, and your problem is a different one. I believe you haven't noticed that I am not Tom Fitch - so you see how easy it is to get confused. :)

Share this post


Link to post
Share on other sites

Yep, I didn't notice that it was someone else asking the question, sorry for the confusion. Did your question got answered, Debbie?

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.