Parameters and compiled report

Stimulsoft Reports.NET discussion
Post Reply
dikan
Posts: 202
Joined: Thu Jun 18, 2009 5:05 pm
Location: Serbia

Parameters and compiled report

Post by dikan »

When I read report from .mrt file and compile it my parameters go well to report and everything goes smooth but when I read report from .dll I could not passs parameters to my reports. It looks that only not precompiled reports can be supplied with application parameters.

Is it true?

Regards
Jan
Posts: 1265
Joined: Thu Feb 19, 2009 8:19 am

Parameters and compiled report

Post by Jan »

Hello,

Please show me code which you use for initialization parameters in second case.

Thank you.
dikan
Posts: 202
Joined: Thu Jun 18, 2009 5:05 pm
Location: Serbia

Parameters and compiled report

Post by dikan »

I am using Clarion 6 for my application development and I create little COM wrapper to connect with StimulSoft.Reporter.Net, so the only difference is in starting lines in my original Clarion code everything is same and I have to mention that report is shown in both version but in first case it obeys the value of variables but in second it does not.

First case
Rpt{'LoadReport("Fakt.mrt")'}
Rpt{'CompileReport'}

Second case
Rpt{'GetFromAssembly("Fakt.dll")'}

Rest is same for both case
Rpt{'SetVariable("I_PGod",2008)'}
Rpt{'SetVariable("I_Sklad",1)'}
Rpt{'SetVariable("I_VrDok",3)'}
Rpt{'SetVariable("I_BrDok",551)'}
Rpt{'ShowReportInModalWindow'}

Below is C# code which I am using for COM wrapper

public void GetFromAssembly(string fileName)
{
Report = StiReport.GetReportFromAssembly(fileName);
}

public void ShowReportInModalWindow()
{
Report.Show(true);
}

public void LoadReport(string fileName)
{
Report.Load(fileName);
}

public void CompileReport()
{
Report.Compile();
}

Regards
Jan
Posts: 1265
Joined: Thu Feb 19, 2009 8:19 am

Parameters and compiled report

Post by Jan »

Hello,

Please use following code to fill report variable in compiled report (sorry c#):
compiledReport["MyVariable"] = 123;
Thank you.
johnham
Posts: 98
Joined: Fri Sep 19, 2008 2:27 pm
Location: Richland, WA, USA

Parameters and compiled report

Post by johnham »

Your Clarion Code is calling the SetVariable method to set the properties. I don't see a SetVariable method in your COM wrapper.

maybe something like this.

Code: Select all

public void SetVariable(string name, int value)
{
   Report[name] = value;
}
I have done a lot of work with Stimulsoft in Clarion but have yet to work with any "Compiled Reports" and I do most of the C# side of the work with another programmer doing a majority of the Clarion Side so I may have interpretted your COM Syntax wrong. However, I believe that is what you need.
Thanks,
John Hamilton
Hamilton & Company, LLC
Jan
Posts: 1265
Joined: Thu Feb 19, 2009 8:19 am

Parameters and compiled report

Post by Jan »

Hello,

Your code is correct.

Thank you.
Post Reply