Showing posts with label disk. Show all posts
Showing posts with label disk. Show all posts

Wednesday, March 21, 2012

generating reports and saving them on the disk

Hi,

I want to know how to generate reports as pdf and save them on the disk 'automatically' at regular intervals. I have seen some links by googling but none satisfactory. If any of you have already done this and it works well for you, please share the info.

Can they be saved to the database automatically?

Please give you answer considering that all this is very new to me :)

I appreciate the help. thanks

ROn.

A step by step generation of rdlc as pdf and saving it on a given folder location is given in the foll post.

http://technoblab.blogspot.com

Do u want the rdlc itself to be generated and saved periodically w/o user intervention then ?

Then probablly I'll try ..

.......................................................................

Please "Mark As Answer" on the post that helped you.

|||

Hi,

Thanks. I need to automate the process. How to do that. Plz help.

thanks

|||

Anyone who could help me here!!

|||

hey,


Implement windows service which will run in the background and generate the report each interval time you specify in thetime ticker in the service app.config

to do this you can read the full example in this link http://en.csharp-online.net/Creating_a_.NET_Windows_Service%E2%80%94The_Timer_Approach

each time the timer method execute you call the reporting service web service and execute the report then stream the result and save it on your local server

sql

Generating report from Code

I need to generate and save a report to disk from a standard Windows
Application without user intervention.
So basically, a user clicks a button, and a report is saved to his c:\ in a
predefined format and with a predefined filename.
Anyone?
J. Jespersen> So basically, a user clicks a button, and a report is saved to his c:\ in
> a
> predefined format and with a predefined filename.
Correction: File should just be saved to the servers c:\|||This code will allow you to generate a report, and create a PDF file from it.
You can tweak the parameters to export the format and type you wish:
public static void deliverReport()
{
MyReportingService.ReportingService rs = new ReportingService();
rs.Credentials = System.Net.CredentialCache.DefaultCredentials;
// Render arguments
byte[] rpt = null;
string reportPath = "/ReportProject1/Report1";
string format = "PDF";
string historyID = null;
string devInfo =@."<DeviceInfo><StartPage>0</StartPage><PageHeight>8.5in</PageHeight><PageWidth>14in</PageWidth></DeviceInfo>";
ParameterValue[] parameters = new ParameterValue[0];
DataSourceCredentials[] credentials = null;
string showHideToggle = null;
string encoding;
string mimeType;
Warning[] warnings = null;
ParameterValue[] reportHistoryParameters = null;
string[] streamIDs = null;
SessionHeader sh = new SessionHeader();
rs.SessionHeaderValue = sh;
rpt = rs.Render(reportPath, format, historyID, devInfo,
parameters, credentials,
showHideToggle, out encoding, out mimeType, out
reportHistoryParameters, out warnings,
out streamIDs);
FileStream stream = File.Create("test.pdf", rpt.Length);
stream.Write(rpt, 0, rpt.Length);
stream.Close();
}
This URL may help you as well:
http://www.csharphelp.com/archives3/archive545.html
Cheers,
Rich
"Jeppe Dige Jespersen" wrote:
> > So basically, a user clicks a button, and a report is saved to his c:\ in
> > a
> > predefined format and with a predefined filename.
> Correction: File should just be saved to the servers c:\
>
>|||Thank you Rich. Works perfectly! :-)
Jeppe Jespersen
Denmark
> This code will allow you to generate a report, and create a PDF file from
> it.
> You can tweak the parameters to export the format and type you wish:
> public static void deliverReport()
> {
> MyReportingService.ReportingService rs = new
> ReportingService();
> rs.Credentials = System.Net.CredentialCache.DefaultCredentials;
> // Render arguments
> byte[] rpt = null;
> string reportPath = "/ReportProject1/Report1";
> string format = "PDF";
> string historyID = null;
> string devInfo => @."<DeviceInfo><StartPage>0</StartPage><PageHeight>8.5in</PageHeight><PageWidth>14in</PageWidth></DeviceInfo>";
> ParameterValue[] parameters = new ParameterValue[0];
> DataSourceCredentials[] credentials = null;
> string showHideToggle = null;
> string encoding;
> string mimeType;
> Warning[] warnings = null;
> ParameterValue[] reportHistoryParameters = null;
> string[] streamIDs = null;
> SessionHeader sh = new SessionHeader();
> rs.SessionHeaderValue = sh;
> rpt = rs.Render(reportPath, format, historyID, devInfo,
> parameters, credentials,
> showHideToggle, out encoding, out mimeType, out
> reportHistoryParameters, out warnings,
> out streamIDs);
> FileStream stream = File.Create("test.pdf", rpt.Length);
> stream.Write(rpt, 0, rpt.Length);
> stream.Close();
> }
> This URL may help you as well:
> http://www.csharphelp.com/archives3/archive545.html
> Cheers,
> Rich
> "Jeppe Dige Jespersen" wrote:
>> > So basically, a user clicks a button, and a report is saved to his c:\
>> > in
>> > a
>> > predefined format and with a predefined filename.
>> Correction: File should just be saved to the servers c:\
>>