Goal: Generate a PDF on button click on a custom form.
So far:
Created a BAQ with 2 parameters
Created Report Data Definition based on BAQ and created report criteria set
Created Report Style that uses Report DD
Created SSRS RDD for Report Style
Formatted SSRS RDD and published.
Added report to Menu - Tested work as I would hope.
Added Button to form.
Added code ProcessCaller.LaunchForm(oTrans, “52”); to button_click
Result:
Report Form comes up I type in parameter values, prints report – All good.
Now I would like to pass the parameters to the form so customer doesn’t have to fill them in and if I am able to do that next would be to just submit the report automatically.
I cannot figure out how to pass parameters to the print form in code. I have tried passing a LaunchFormOptions variable but the form looks totally different so I am sure I am doing something wrong.
I would offer that you have the user enter the parameters in the first form and send those using the LaunchFormOptions (as @bordway states) to the Report Form. Howeever, if that is not possible, then it can be done the way you suggest.
The button is on a new sheet in the Opportunity/Quote Entry screen. It’s highly customized worksheet for our sales group. There is no “BAQ Report” in the solution. In quotes because I am not sure how you mean it. I never used the “BAQ Report Designer”. I created a Report Style that uses a Report DD that uses my BAQ as the source.
I have the parameters I want to pass in the calling form. Just don’t how to send them to called form and have it apply them.
I’m not sure I’m following…I don’t think the way you made the report should make a difference?
Where I’m assuming the menu ID item for the report is calling a report style?
and then your button on the main form is using LFO to call that menu ID (and pass any parameters needed via the LFO), which in turn launches the report form (and customize to handle any parameters being passed?
If I put in the quote and line#'s the report will run as I hope. I am trying to pre populate those parameters. I already have the values I want to pass in the calling form.
Aft first glance…
I don’t see a customization specified for the menu ID (52)
That customization is where I would normally add the LFO handling.
Attached word doc is just a copy of the thread I referenced in the beginning/
See if that is easier to follow/helps - and let me know if not I might have time to add screenshots to it later. LFO Basics.doc (38.5 KB)
I know… LFO is not intuitive, once you get it though, works well.
I was trying to customize the form after being called from the button and I didn’t have permissions. Finally realized my mistake and customized the form after starting it right from the menu. Now I am able to add the code from the document/link shared and I am good to go. Thanks to all who took the time to help me. Happy new year!
Hi! I have exactly similar case here. Managed to do this in baq report previously but in this rdd report I get error setting parameter (option).
How did you set values to QuoteNumber and LineNumber? When I try to set those in DynamicCriteriaReportForm_Load getting values from LaunchFormOptions I’ll get error that control (sid number) does not exist using command below
var txtItem = (Ice.Lib.Framework.EpiTextBox)csm.GetNativeControlReference(“c33b3dbb-dd86-47ec-a0dc-b07d2fa5caab”);
The GUID (the “c33b3dbb-dd86-47ec-a0dc-b07d2fa5caab” part) is unique to your system. You need to find that control’s GUID, and adjust the code to use it. In customization mode, click on the control whose GUID you need to know, then in the developer window, go to the properties tab and the GUID will be listed.
On the button click action on my form I added code to gather the two values I wanted to pass to the SSRS report critera. And called the menu item for the SSRS passing the quote and line#
private void prtOpersButton_Click(object sender, System.EventArgs args)
{
EpiTextBox QuotNum = (EpiTextBox)csm.GetNativeControlReference(“8e25166f-6185-4497-b3d6-1798e4e9c4a0”);
EpiUltraComboPlus LineNum = (EpiUltraComboPlus)csm.GetNativeControlReference(“fa359824-fd06-42b4-9f2c-e31d23d4f97e”);
string currentQtNum=QuotNum.Text;
string currentLineNum=LineNum.EpiCombo.Text;
LaunchFormOptions lfo = new LaunchFormOptions();
lfo.IsModal = true;
lfo.ContextValue=currentQtNum +“,”+currentLineNum; // Make string values delimited
ProcessCaller.LaunchForm(oTrans, “52”,lfo); //52 is the menu id
}
Then on the Load Form event I loaded the quote/line # to the report critera and printed:
private void DynamicCriteriaReportForm_Load(object sender, EventArgs args)
{
if (DynamicCriteriaReportForm.LaunchFormOptions != null && DynamicCriteriaReportForm.LaunchFormOptions.Sender != null)
{
Thank’s for your answer. That is exactly what I’m doing in my code. It would be similar if you would get error setting
" EpiTextBox quoteTextBox = (EpiTextBox)csm.GetNativeControlReference(“eb773ce2-4fac-451c-8372-3d4bcf9aaf26”); "
I must have a sid mismatch between customation form display and actual sid somewhere in system.