Dr. Evil Posted October 20, 2009 Posted October 20, 2009 How can show a page count for mulitple reports in the same found set. I have a script called "Quote", I have it so user can choose to print Current Record only which would just produce one quote report, or user can choose print Current Found Set which would produce a quote for each record in found set. I'm currently using (PAGE ## OF <>) for a page count, this works for Current Record only, but NOT for the Current Found Set. Sense glb_page_count is set via script; go to record; last set field (glb_page_count);## go to record; first So of course this will not work when there are multiple reports. Sorry for any confusion caused do to my poor terminology, I'm attaching screen shots to help illustrate my issue. Any solutions to this problem? Thank you all for your time and help.
mfrapp Posted October 20, 2009 Posted October 20, 2009 why not use Get(FoundCount) in a unstored calc field ## / <>
Dr. Evil Posted October 20, 2009 Author Posted October 20, 2009 can you explain how to implement this? A little confused. I think get(foundcount) gets count of records. I need found count of pages. I could be wrong, have not researched/tested.
mfrapp Posted October 21, 2009 Posted October 21, 2009 ya sorry that wont work, unless you have 1 page per record
bcooney Posted October 21, 2009 Posted October 21, 2009 If I understand correctly, you are printing Quotes from the line items table, as a subsummary report. Correct? This will not give you the proper total page count, bcs individual quote line items are not isolated. You need to create a script that starts in the parent table ( that you are using to group quote line items? A parent Quote table?). A script from the Quote table will go to related line items (now you've isolated them), sort, preview, go to last page, set global page count, go to first, pause, print. To print all found Quotes (again from the parent Quote table), you'd write a looping script that performs the Print Quote script.
Dr. Evil Posted October 21, 2009 Author Posted October 21, 2009 Yes, you are correct. I have what you explained set up already. But the looping pause/continue script is not ideal for me. At the end of a month I will quote or invoice my clients, there may be 50+ invoices... I don't want to click continue 50+ times. I could take the pause out, but the print dialogue would still show up. For the print dialogue I could also make automatic.... but then i'm leaving user with no preview, and no opportunity to cancel. You can see how this problem has been a thorn in my side. Thank you for your help! Maybe you see a solution I'm not getting.
bcooney Posted October 21, 2009 Posted October 21, 2009 The answer is to loop without a pause, and print without a dialog. (or get fancy and email a pdf). You could put a dialog before the loop that says, "Create a Quote for each of the 100 found customers?"
Dr. Evil Posted October 24, 2009 Author Posted October 24, 2009 Bcooney! With your advise, I have decided to build my reports using your suggested model of reporting with a loop, I see there are more advantages then just the ability to have a page count. I'm writing you to kindly ask how you would set up this looping report? Just an outline and the key details. I have an idea on how I would accomplish this, but I'm still learning and would like a pros guidance. I appreciate your time, thank you!
bcooney Posted October 24, 2009 Posted October 24, 2009 Hi Randy, Well, you'd start with a found set of Quotes that haven't yet been sent. You need a DateSent field in Quotes. Find all quotes where DateSent is empty. Do you want to email the quote or print it? Maybe the answer depends upon whether you have an email for the customer that is related to the quote.
Dr. Evil Posted October 25, 2009 Author Posted October 25, 2009 I would want to give the user the option to print, email or save to disk. If [report_target_key = "Email"; perform report Quote Email If [report_target_key = "Print"; perform report Quote Print You do bring up a valid point, what if you are printing multiple quotes, user chooses email option and 1 or 2 out of the 13 quotes does not have an associated email address? There would have to be some sort of warning or notification saying 2 of the 13 where NOT sent. You mentioned a quote_date_sent field, using this as an identifier telling loop if empty;report, if not empty; end loop? Would this work if user wanted to print/email quote more then once? Would have to clear the loop identifier?... I don't know. Wondering what tricks you have up your sleeve from past experience on this? THANK YOU!!
bcooney Posted October 25, 2009 Posted October 25, 2009 Lots of experience with such a routine, Randy. You have choices to make. Your logic could be: if an email, send as pdf attachment, otherwise print. Or, if Customer's preferred method of contact is email, email, otherwise print. Yes, you need a date quote sent that will get set in the looping script. This helps you find the records that will be sent. You could have a button on the Quote form that allows for "resending."
Dr. Evil Posted October 25, 2009 Author Posted October 25, 2009 (edited) I have taken what I know and built a sample file, its attached. Sample file handles users request on options print, email or save file. Tho the details on these are sketchy, I can't figure out how to set file name to serial number and set email details like address, subject, etc... Sample file does NOT currently handle users request on options of report on Current or All records. I do not fully understand how to do this in clean stable manor. If you don't mind, can you take a look and my sample file and help me solve these problems? Again, thank you for your time and help! Your experience and expertise is appreciated. multi_report_model.fp7.zip Edited October 25, 2009 by Guest Added samle file
bcooney Posted October 26, 2009 Posted October 26, 2009 Randy, I'm really a lazy person. And so, I didn't look at your file, but instead just created my own. If you want me to still look at your file after you've checked out this demo, let me know. It is nice to learn from mistakes. Quotes.fp7.zip
Dr. Evil Posted October 27, 2009 Author Posted October 27, 2009 AWESOME! Thank you for your file, it demonstrates some of the key script steps I needed. Thank you kindly for your help!
bcooney Posted October 27, 2009 Posted October 27, 2009 Glad to help. Don't hesitate to ask more questions.
Dr. Evil Posted November 9, 2009 Author Posted November 9, 2009 guess what... I do have another question. LOL most likely will have more. Hers my question. In the quote script I would like User to be able to choose the path via browser where to save the quote PDF. I have noticed that if I leave "Specify output file" blank... the dialogue and browser will pop up and allow User to choose where to save file. The only PROBLEM with this is, the file name defaults to"Untitled.pdf" and I want it to default to "1334_QUOTE.pdf" Do you know a solution? THANKS SO MUCH! :)
bcooney Posted November 9, 2009 Posted November 9, 2009 I think you're stuck. You cannot name the file but give the user the ability to choose the directory. Easy answer is to save to the Desktop (Get (DesktopPath) and tell them after the Save As PDF step that a file named "filename" has been saved to their desktop. More complicated is to show a dialog with directory choices and branch the script accordingly. You might want to look at Troi plugins.
DykstrL Posted November 13, 2009 Posted November 13, 2009 Actually, you can name the file with a variable - you just have to use something based on the record. You could set up a popup to ask for a file name, then use that. I use this for our printing orders. It names the file the PO number. I also use the desktop ( Get(DesktopPath) ) as the default place to create the file. It's not perfect, but it's usually easy for non-techies to find the file.
aholtzapfel Posted November 13, 2009 Posted November 13, 2009 Get(TemporaryPath) Is really a better place to save the pdf if all you wanted to do is send it. This makes it a little cleaner. (using the the same varible to attach it to a send mail script step that addresses it to the intended recipient.)
bcooney Posted November 14, 2009 Posted November 14, 2009 You can only name the file if you specify a path. He does not want to specify the path, just the file name. The two are combined, and as far as I can see, you cannot do one and not the other.
aholtzapfel Posted November 14, 2009 Posted November 14, 2009 Where there is a will there is a way. (In this case it not hard to think of a solution). Add a Global Field to your table, add a custom dialog script step (Asking for the name the file should be called), Set the path varible with a calulation that uses the name in the global field, save as a PDF(no dialog), send mail (attaching the pdf). This way the only interaction a user has to do after starting the script is provide a filename, hit ok, and hit send (are ways to send without dialog)
bcooney Posted November 15, 2009 Posted November 15, 2009 His goal is NOT to send. He wants to script the name of the file (which involves a path) but let the user pick the directory in which to save (which involves a path that would be unknown to the script). So, it's a vicious circle, afaik.
Recommended Posts
This topic is 5557 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now