Forum » Programiranje » save pdf na disk
save pdf na disk
tedl25 ::
Živjo,
imam en problem in sicer bi rad da ko kliknem na gumb se mi report avtomatsko shrani da disk v pdf obliki. Prikazat ga znam v pdf-ju samo nikakor ga ne morem shraniti.
Ima kdo kakšno idejo? Delam pa v VS2003 asp.net (C#)
hvala
lp
private void Button1_Click(object sender, System.EventArgs e)
{
SqlConnection sqlConnection1 = new SqlConnection(ConfigurationSettings.AppSettings["povezava"]);
SqlDataAdapter da = new SqlDataAdapter("select * from posta1" , sqlConnection1 );
da.Fill(dataSet11,"posta1");
myReport.Load(Server.MapPath(Request.ApplicationPath)+"\\CrystalReport1.rpt");
MemoryStream oStream; // using System.IO
myReport.SetDataSource(dataSet11);
oStream = (MemoryStream)
myReport.ExportToStream(
CrystalDecisions.Shared.ExportFormatType.PortableDocFormat );
Response.Clear();
Response.Buffer= true;
Response.ContentType = "application/pdf";
Response.BinaryWrite(oStream.ToArray());
Response.End();
}
imam en problem in sicer bi rad da ko kliknem na gumb se mi report avtomatsko shrani da disk v pdf obliki. Prikazat ga znam v pdf-ju samo nikakor ga ne morem shraniti.
Ima kdo kakšno idejo? Delam pa v VS2003 asp.net (C#)
hvala
lp
private void Button1_Click(object sender, System.EventArgs e)
{
SqlConnection sqlConnection1 = new SqlConnection(ConfigurationSettings.AppSettings["povezava"]);
SqlDataAdapter da = new SqlDataAdapter("select * from posta1" , sqlConnection1 );
da.Fill(dataSet11,"posta1");
myReport.Load(Server.MapPath(Request.ApplicationPath)+"\\CrystalReport1.rpt");
MemoryStream oStream; // using System.IO
myReport.SetDataSource(dataSet11);
oStream = (MemoryStream)
myReport.ExportToStream(
CrystalDecisions.Shared.ExportFormatType.PortableDocFormat );
Response.Clear();
Response.Buffer= true;
Response.ContentType = "application/pdf";
Response.BinaryWrite(oStream.ToArray());
Response.End();
}
tedl25 ::
Živjo,
imam en problem in sicer bi rad da ko kliknem na gumb se mi report avtomatsko shrani na disk v pdf obliki. Prikazat ga znam v pdf-ju samo nikakor ga ne morem shraniti.
Ima kdo kakšno idejo? Delam pa v VS2003 asp.net (C#)
hvala
lp
private void Button1_Click(object sender, System.EventArgs e)
{
SqlConnection sqlConnection1 = new SqlConnection(ConfigurationSettings.AppSettings["povezava"]);
SqlDataAdapter da = new SqlDataAdapter("select * from posta1" , sqlConnection1 );
da.Fill(dataSet11,"posta1");
myReport.Load(Server.MapPath(Request.ApplicationPath)+"\\CrystalReport1.rpt");
MemoryStream oStream; // using System.IO
myReport.SetDataSource(dataSet11);
oStream = (MemoryStream)
myReport.ExportToStream(
CrystalDecisions.Shared.ExportFormatType.PortableDocFormat );
Response.Clear();
Response.Buffer= true;
Response.ContentType = "application/pdf";
Response.BinaryWrite(oStream.ToArray());
Response.End();
}
Vredno ogleda ...
Tema | Ogledi | Zadnje sporočilo | |
---|---|---|---|
Tema | Ogledi | Zadnje sporočilo | |
» | C# težavaOddelek: Programiranje | 3729 (2575) | mladec |
» | [C#,SQL]Oddelek: Programiranje | 1243 (1156) | JanOlMajti |
» | Statistika dijakov, pomocOddelek: Programiranje | 1783 (1267) | Mitja Bonča |
» | [C#] Dostop do objekta iz različnih formOddelek: Programiranje | 2163 (1876) | Kekec |
» | [C#] DATA GRID VIEWOddelek: Programiranje | 1943 (1823) | Kekec |