How to call report once SETUP file created

Stimulsoft Reports.NET discussion
jayanthi
Posts: 61
Joined: Wed Aug 26, 2009 4:32 am

How to call report once SETUP file created

Post by jayanthi »

Hai,

I have created a report and saved it in a separate folder but not inside bin.
Eg;
I have saved the report in the following path;
"E:\My Folder\Jayanthi\Maha Izah\Project\MahaIzah\MahaIzah\Transport"
So in code i have loaded the report as like below
report.Load(strStimulsoftPath + "\rptDailyClaim.mrt")
strStimulsoftPath ------ variable to get the path dynamically.

I have created SETUP file for my application and tried to run the report. But it's throwing error like report not exists

Please guide me

Thank you
Jay
Jan
Posts: 1265
Joined: Thu Feb 19, 2009 8:19 am

How to call report once SETUP file created

Post by Jan »

Hello Jay,

You need specify correct path to report in Load method. You can use following code if you need up to one level:

Code: Select all

report.Load("...\\reports\\report.mrt");
Thank you.
jayanthi
Posts: 61
Joined: Wed Aug 26, 2009 4:32 am

How to call report once SETUP file created

Post by jayanthi »

I have stored my report in the path "E:\My Folder\Jayanthi\Maha Izah\ Project\ MahaIzah\ MahaIzah\ Transport\Reports\Daily Claim\rptDailyClaim.mrt"

In source code i have load the report as like
report.Load(E:\My Folder\Jayanthi\Maha Izah\ Project\ MahaIzah\ MahaIzah\ Transport\Reports\Daily Claim\rptDailyClaim.mrt)

Then I have created a setup & deployment for that application. In that i have added the following dll files of stimulus

1. Stimulsoft.Report.dll
2. Stimulsoft.Report.Design.dll

Am getting error while execute that report from EXE; it throws error like report not exists.

Please help me to fix the error.

Thanx
Jay
Edward
Posts: 2913
Joined: Fri Jun 09, 2006 4:02 am

How to call report once SETUP file created

Post by Edward »

Hi Jay,

Here is the complete list of our dlls for Stimulsoft Report:

Stimulsoft.Base.dll
Stimulsoft.Controls.dll
Stimulsoft.Controls.Win.dll
Stimulsoft.Database.dll
Stimulsoft.Editor.dll
Stimulsoft.Report.dll
Stimulsoft.Report.Design.dll
Stimulsoft.Report.Win.dll
Stimulsoft.Report.Web.dll

And did you run your application without setup program?

What is the error message you received after running of that installed application?

Thank you.
jayanthi
Posts: 61
Joined: Wed Aug 26, 2009 4:32 am

How to call report once SETUP file created

Post by jayanthi »

Hai,

Am able to run the report without creating setup file.

I have created setup file and installed it the path "C:\Program Files\GGT E-Solutions\Setup1"

From that EXE i have tried to run the stimulsoft report which shows error like "Could not find file "C:\Program Files\GGT E-Solutions\Setup1\rptDailyClaim.mrt"

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

How to call report once SETUP file created

Post by Jan »

Hello Jay,

This error is correct. You try to load report from "E:\My Folder\Jayanthi\Maha Izah\ Project\ MahaIzah\ MahaIzah\ Transport\Reports\Daily Claim\rptDailyClaim.mrt" in your program. But you install program (and report) to "C:\Program Files\GGT E-Solutions\Setup1\rptDailyClaim.mrt". How report engine can load your report from old path?! You need use relative path, not absolute.

Thank you.
jayanthi
Posts: 61
Joined: Wed Aug 26, 2009 4:32 am

How to call report once SETUP file created

Post by jayanthi »

Hai Jan,

Please can you guide me how to use Relative Path?
Its urgent.

Thank u
Jay
jayanthi
Posts: 61
Joined: Wed Aug 26, 2009 4:32 am

How to call report once SETUP file created

Post by jayanthi »

Hello,

My project located in the path "E:\My Folder\Jayanthi\Maha Izah\ Project\ MahaIzah"
My Report located in the path "E:\My Folder\Jayanthi\Maha Izah\ Project\ MahaIzah\ MahaIzah\ Transport\Reports\Daily Claim\"

In a report I have wirte code like "report.Load(E:\My Folder\Jayanthi\Maha Izah\ Project\ MahaIzah\ MahaIzah\ Transport\Reports\Daily Claim\rptDailyClaim.mrt)"
While run the application rptDailyClaim.mrt report getting displayed.

I have modified the above code as like "report.Load(strStimulsoftPath + "\rptDailyClaim.mrt")"
strStimulsoftPath is the string to get application root path.


I have deployed the project in the path "C:\Program Files\GGT E-Solutions\Setup1"

After deployment am not able to run the stimulsoft report its throwing error like "could not find the report rptDailyClaim.mrt"

Actually in crystal report it will run the report directly, is it possible to do the same with this.

Thanx
Jay
Edward
Posts: 2913
Joined: Fri Jun 09, 2006 4:02 am

How to call report once SETUP file created

Post by Edward »

Hi Jay,

You also can store the report template in the StiReport component in the WinForm. Just drrag and drop StiReport component from toolbox in VisualStudio in the form in your project, right-click in this component and select 'Design'. After designing of the report you can get report template as follows:

Dim Report = StiReport1.GetReport()

In that case you do not need any external mrt files for access the report template.

Thank you.
jayanthi
Posts: 61
Joined: Wed Aug 26, 2009 4:32 am

How to call report once SETUP file created

Post by jayanthi »

Hai,

I have tried as like report = StiReport3.GetReport()

In that report i have variables.
Am passing values to the variable as like "report.Dictionary.Variables("cmpName").Value = cmpName"

While run the report it shows error like "Object reference not set to an instance of an object". Error displays for the above code.

Thanx
Jay
Post Reply