Page 1 of 1

Parameters and compiled report

Posted: Thu Jul 02, 2009 6:23 pm
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

Parameters and compiled report

Posted: Fri Jul 03, 2009 5:52 am
by Jan
Hello,

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

Thank you.

Parameters and compiled report

Posted: Fri Jul 03, 2009 11:35 am
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

Parameters and compiled report

Posted: Mon Jul 06, 2009 7:20 am
by Jan
Hello,

Please use following code to fill report variable in compiled report (sorry c#):
compiledReport["MyVariable"] = 123;
Thank you.

Parameters and compiled report

Posted: Wed Jul 08, 2009 4:59 pm
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.

Parameters and compiled report

Posted: Fri Jul 10, 2009 1:36 pm
by Jan
Hello,

Your code is correct.

Thank you.