|
hi guys i came with solution regarding...
get the PdfSharp.dll from website and then include in yours
the do the following..
it will work like gun...
using PdfSharp.Pdf;
using PdfSharp.Pdf.IO;
Stream[] ChildStream = new Stream[ReportDoc.Length];
Stream OutStream = new MemoryStream();
PdfDocument[] PdfChildDoc = new PdfDocument[ReportDoc.Length];
PdfDocument OutPutPage = new PdfDocument();
for (int i = 0; i < ReportDoc.Length; i++)
{
ChildStream[i] = (Stream)ReportDoc[i].ExportToStream(CrystalDecisions.Shared.ExportFormatType.PortableDocFormat);
PdfChildDoc[i] = PdfReader.Open(ChildStream[i], PdfDocumentOpenMode.Import);
}
for (int i = 0; i < PdfChildDoc.Length; i++)
{
int count = PdfChildDoc[i].PageCount;
for (int idx = 0; idx < count; idx++)
{
// Get the page from the external document...
PdfPage page = PdfChildDoc[i].Pages[idx];
// ...and add it to the output document.
OutPutPage.AddPage(page);
}
}
OutPutPage.Save(OutStream, false);
//byte[] b = new byte[OutStream.Length];
//OutStream.Read(b, 0, b.Length);
Response.Buffer = true;
Response.ContentType = "application/pdf";
Response.BinaryWrite(((MemoryStream)OutStream).ToArray());
|
|
|
|
|
i have made a web application which run smoothly at local system but when i uploaded on web server and trying to login it gives runtime error
error is:
Runtime Error
Description: An application error occurred on the server. The current custom error settings for this application prevent the details of the application error from being viewed remotely (for security reasons). It could, however, be viewed by browsers running on the local server machine.
Details: To enable the details of this specific error message to be viewable on remote machines, please create a <customerrors> tag within a "web.config" configuration file located in the root directory of the current web application. This <customerrors> tag should then have its "mode" attribute set to "Off".
<configuration>
<system.web>
<customerrors mode="Off">
Notes: The current error page you are seeing can be replaced by a custom error page by modifying the "defaultRedirect" attribute of the application's <customerrors> configuration tag to point to a custom error page URL.
<configuration>
<system.web>
<customerrors mode="RemoteOnly" defaultredirect="mycustompage.htm">
Thanks in advance
|
|
|
|
|
Then do as for as its Info, you can able to login. let me know if error comes after that
|
|
|
|
|
Hi!
I have been programming a web application with ASP.NET (.Net version 2) . when I run it on localhost, all things are correct. but when I upload files on my web server, many things are out of placed.
for example:
1. footer of my page: in localhost, it's on center of the page. in server, it's on right of the page.
2. Textbox sizes: in localhost, they are regular size. but in server, they are bigger and out of their regular place.
How can I do to correct this problem?
Regards.Mahdi Ghiasi
modified on Friday, February 12, 2010 2:04 AM
|
|
|
|
|
I guess you dont have proper css files published properly. Or the browser doesnt download them correctly.
Check the View-Source and see if the deployment and development sources are different.
There is no way that browser behaves differently when same code is executed. The problem must be in the html generated.
You can also look for other external files which are downloaded with the page is working correctly or not.
To simplify your task, Use Fiddeler[^]
|
|
|
|
|
Good One.
|
|
|
|
|
How I can download for example: from country it's cities, when I'll click co country page must redirect me corresponding cities...
C# Developer
|
|
|
|
|
Perhaps you'd like to take a few moments to compose your question better and edit it so it is understandable what you are asking for and what you would like. I know the language. I've read a book. - _Madmatt
|
|
|
|
|
well I'm using Entity Framework(I'm newbie in this)
I have Entities Country cities with onetomany realtionships
in domain are generated both of this classes, with it's properties...
but in cities There is only City.ID and for CountryID there is reference to Class country: public EntityReference<Country> CountryReference{//...}
and in Country Class:public EntityCollection<Cities> City{//...}
<asp:EntityDataSource ID="src" runat="server" ContextTypeName="Namespace.Domain" EntitySetName="Cities"
EntityTypeFilter="City" EnableInsert="true" EnableUpdate="true"EnableDelete="true">
<WhereParameters>
<asp:QueryStringParameter Name="here must be CountryID,but in class there is not such property" type="int32" DefaultValue="0" QueryStringField="CountryID">
</WhereParameters>
</asp:EntityDataSource>
sorry for my bad English
C# Developer
|
|
|
|
|
Hi gurus,
I have been looking around how to display stored images(varbinary(max)) from sql server2005 to Gridview. But I was unable to find a decent answer on google.
Do anyone of you have ever come across to this problem, if so, would you help me or perhaps suggest me to a resource.
Thanks
|
|
|
|
|
|
Thanks for replying. I am looking a solution for Asp.net. However, this is mentioned for client side applications.
I would like to know also which is a better way:
1. Display stored image as a blob format on gridview is faster or
2. Re-create blob image on the disk first and then point loction.
Thanks
|
|
|
|
|
|
I'm calling and aspx page with a color param. I need this color to be passed on the querystring, so I call the aspx as:
somepage.aspx?color=#FFFFFF&...
The color parameter in the querystring is set by ColorTranslator.ToHtml(Color)
I think here the problem is the # symbol. Is there a problem passing # as a parameter? How can i get back my Color object from this querystring ?
I tried :
if (!string.IsNullOrEmpty(Context.Request.QueryString["color"]))
Color = ColorTranslator.FromHtml(Context.Request.QueryString["color"]);
but for some reason the above if statement evaluates to false. How can I fix this ?
TIA
|
|
|
|
|
This seems to work:
protected void Page_Load(object sender, EventArgs e)
{
String Color;
if (Request.QueryString["color"] != null)
{
Color = Request.QueryString["color"];
}
}
protected void Button1_Click1(object sender, EventArgs e)
{
String URL = "Default.aspx?color=" + Server.UrlEncode("#FFFFFF");
Response.Redirect(URL);
}
Steve Wellens
|
|
|
|
|
You mean
paper67 wrote: if (!string.IsNullOrEmpty(Context.Request.QueryString["color"]))
Evaluates to false ?
Did you put the QueryString correctly.
Use HttpUtility.UrlEncode before sending the color code. And after fetching use HttpUtility.UrlDecode to get the color code back properly.
|
|
|
|
|
From the asp.net page, I would like to view the reporting services reports i.e. the .rdl files.
I am using a reportviewer to access one of the reports as follows. Notice that I have hardcoded the name of the .rdl report.
Question:
There are several reports. The names are stored in a table in the database. Do you know how I can populate a listbox with the names of the reports but do not know how to show the selected report in the viewer. Notice that at present I am hardcoding just one name and not sure how to be able to show the selected report
<rsweb:ReportViewer ID="ReportViewer1" runat="server" ProcessingMode="Remote"
Font-Names="Verdana" Font-Size="8pt" Height="1000px" Width="1000px" >
<ServerReport ReportServerUrl="http://reportserver/reportserver"
ReportPath="/reportfiles/myReport" />
</rsweb:ReportViewer>
Any thoughts please?
thanks
|
|
|
|
|
You can try below code because what i did in the code is added reportviewer control dynamically to div control on page
and its working file for me
protected void bRunReport_Click1(object sender, EventArgs e)
{
if (Page.IsValid)
{
divRptView.Controls.Clear();
#region reportviewer setting
ReportViewer ReportViewer1 = new ReportViewer();
ReportViewer1.ProcessingMode = ProcessingMode.Local;
ReportViewer1.ID = "ReportViewer1";
ReportViewer1.Font.Bold = false;
ReportViewer1.Font.Name = "Arial";
ReportViewer1.ShowExportControls = false;
ReportViewer1.ShowBackButton = false;
ReportViewer1.SizeToReportContent = true;
ReportViewer1.BackColor = System.Drawing.Color.WhiteSmoke;
ReportViewer1.LocalReport.DataSources.Clear();
#endregion reportviewer setting
string _reportID = string.Empty;
bool isnull = true;
#region snapshot
else if (ddlListofReports.SelectedValue == "1")
{
_reportID = "snapshot";
List<snapshot> slist = new snapshot().GetCustomersForCountry(this.ddljobsSnapshot.SelectedValue);
ReportViewer1.LocalReport.ReportPath = "Admin\\ReportDesigns\\" + _reportID + ".rdlc";
if (slist != null)
{
if (slist.Count > 0)
{
ReportViewer1.LocalReport.DataSources.Add(new ReportDataSource("snapshot1", slist));
isnull = false;
}
}
}
#endregion snapshot
#region VoiceAgentUtilization
else if (ddlListofReports.SelectedValue == "2")
{
DateTime _dcstarttime = Convert.ToDateTime(this.txtAgetnFromDate.Text);
string _dcstarttimestr = _dcstarttime.ToLongDateString() + " " + _dcstarttime.ToLongTimeString();
DateTime _dctotime = Convert.ToDateTime(this.txtAgentTodate.Text);
_reportID = "VoiceAgentUtilization";
List<AgentDetailed> alist = new AgentDetailed().getAgentReport(this.dcagent.SelectedItem.ToString(), _dcstarttime, _dctotime);
ReportViewer1.LocalReport.ReportPath = "Admin\\ReportDesigns\\" + _reportID + ".rdlc";
if (alist != null)
{
if (alist.Count > 0)
{
ReportViewer1.LocalReport.DataSources.Add(new ReportDataSource("AgentDetailed1", alist));
isnull = false;
ReportParameter starttime = new ReportParameter("StartTime", _dcstarttimestr);
ReportParameter endtime = new ReportParameter("EndTime", _dctotime.ToString());
ReportParameter Agent = new ReportParameter("Agent", this.dcagent.SelectedItem.ToString());
ReportParameter[] p = { starttime, endtime, Agent };
ReportViewer1.LocalReport.EnableExternalImages = true;
ReportViewer1.LocalReport.SetParameters(p);
}
}
}
#endregion VoiceAgentUtilization
if (!isnull)
{
lblMessageBox.Visible = false;
if (ddlListofReports.SelectedValue != "11")
{
divRptView.Controls.Add(ReportViewer1);
ReportViewer1.Height = 290 + (25 * 10);
ReportViewer1.Width = Unit.Percentage(91);
ReportViewer1.ShowRefreshButton = false;
ReportViewer1.Visible = true;
ReportViewer1.ShowPrintButton = true;
ReportViewer1.SizeToReportContent = true;
ReportViewer1.LocalReport.Refresh();
}
}
else
{
lblMessageBox.Visible = true;
lblMessageBox.Text = "No Records are avaliable.";
ReportViewer1.Visible = false;
}
}
}
|
|
|
|
|
|
Hello all.
My prev post is some what not formatted, and i am unable to delete also
i got one doubt that, each page has its own response rt??
here i am trying to open the pages in loop,
my code is
for (int i =0 ; i <=1 ;i++)
{
response.write("<script language='javascript'> window.open('page1.aspx',</script>")
}
in my page load of page1.aspx.
i gave like object.exporttohttpresponse(pdf format)
he my loop gets stopped, my question here is i am giving the response of the new page, but why my loops getting stopped and my parent page is still loading due to the post back happend.
i dont understand , guys help me
|
|
|
|
|
maybe I can help you if you explained more.
do you want to open many pages from on page?
|
|
|
|
|
hi,
thanks for your reply.
actually my requirement is to print multiple Crystal report documents at one stretch, as i am unable to concatenate the Crystal report document as well as i tried a lot to convert the Crystal report document to the memory stream an tried
response.binarywrite(memorystream.toarray()),
in the above method i got only the last report document exported to pdf,
so i decided to create an seperatepage.aspx (window)
by which i kept the report document in the session and in the page load of that seperatepage.aspx i exported that reported document to http response,
in the loop
that is,
for (int i =0; i < reportdocument.length;i++)
{
session["reportdoc"] = reportdocument[i];
response.write(" window.open("seperatepage.aspx"))
}
in the page load of the seperatepage.aspx,
((reportdocument)session["reportdoc"]).exporttohttpresponse(pdf format);
hope you can get me now?
|
|
|
|
|
If you want the output of all of the pages on one page the you should call server.Execute on each page rather than generate a script tag for each page.
|
|
|
|
|
If you want the output of all of the pages on one page the you should call server.
i dont really understand by what means you are talking about?
how can i do that then? please read my requirement in the above message,is it possible to do that in your way, if so can you please explain little more how to do the same
waiting for you reply thanks in advance
|
|
|
|
|