Hollie18502
asked on
Creating PDF on the fly
I have an webform and I want to grab the information and create a pdf file without displaying crystal report and export.
In other words, creating pdf on the fly without loading crystal report.
Please forward me any solution
In other words, creating pdf on the fly without loading crystal report.
Please forward me any solution
You still can design your report in crystal report and use the following code to display the output as pdf.
CrystalReportSource1 is the CrystalReportSource control.
MemoryStream oStream;
oStream = (MemoryStream)CrystalRepor tSource1.R eportDocum ent.Export ToStream(C rystalDeci sions.Shar ed.ExportF ormatType. PortableDo cFormat);
Response.Clear();
Response.Buffer = true;
Response.ContentType = "application/pdf";
Response.BinaryWrite(oStre am.ToArray ());
Response.End();
CrystalReportSource1 is the CrystalReportSource control.
MemoryStream oStream;
oStream = (MemoryStream)CrystalRepor
Response.Clear();
Response.Buffer = true;
Response.ContentType = "application/pdf";
Response.BinaryWrite(oStre
Response.End();
ASKER
Grsekar... this sould doable, however, is there a way to save the pdf automatically, without the user have to do it.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
hi code for WebUtility.GetConnectionSt ingValueLi st() function
public static NameValueCollection GetConnectionStingValueLis t()
{
string ConnStr = ConfigurationManager.Conne ctionStrin gs["HRMS"] .ToString( );
string[] constrArray = ConnStr.Split(';');
NameValueCollection ConnStrList = new NameValueCollection();
foreach (string strValue in constrArray)
{
if (!string.IsNullOrEmpty(str Value))
{
string[] tmp = strValue.Split('=');
ConnStrList.Add(tmp[0], tmp[1]);
}
}
return ConnStrList;
}
public static NameValueCollection GetConnectionStingValueLis
{
string ConnStr = ConfigurationManager.Conne
string[] constrArray = ConnStr.Split(';');
NameValueCollection ConnStrList = new NameValueCollection();
foreach (string strValue in constrArray)
{
if (!string.IsNullOrEmpty(str
{
string[] tmp = strValue.Split('=');
ConnStrList.Add(tmp[0], tmp[1]);
}
}
return ConnStrList;
}
u can use a freely available dll called itextsharp for this
follow this link
http://itextsharp.sourceforge.net/
b u d d h a