|
I'm using this below code to create pdf file from ssrs report on button click.It was working fine when i run the project on my local system,but when i hosted it on ISS i'm unable to view the pdf file as o/p.Plz suggest the solution ASAP..
protected void btnAuthenticateAndPrint_Click(object sender, EventArgs args)
{
try
{
LinkButton lb = (LinkButton)sender;
GridViewRow row = (GridViewRow)lb.NamingContainer;
Label lbOrderID = row.FindControl("lbOrderID") as Label;
int OrderId = Convert.ToInt32(lbOrderID.Text);
da = new SqlDataAdapter("Get_PODetails", con);
da.SelectCommand.CommandType = CommandType.StoredProcedure;
da.SelectCommand.Parameters.AddWithValue("@MPDI_ID", OrderId);
ds = new DataSet();
da.Fill(ds, "PO");
if (ds.Tables["PO"].Rows.Count > 0)
{
lblPOId.Text=ds.Tables["PO"].Rows[0]["MPDI_ID"].ToString();
lblVendid.Text = ds.Tables["PO"].Rows[0]["MVDI_ID"].ToString();
lblBranch.Text = ds.Tables["PO"].Rows[0]["MBRI_ID"].ToString();
lblDate.Text = Convert.ToDateTime(ds.Tables["PO"].Rows[0]["MPDI_Date"]).ToString("dd-MMM-yyyy");
}
rs = new RSWebService.ReportingService2005();
rsExec = new REWebService.ReportExecutionService();
rs.Credentials = System.Net.CredentialCache.DefaultCredentials;
rsExec.Credentials = System.Net.CredentialCache.DefaultCredentials;
rs.Url = "http://localhost/ReportServer/ReportService2005.asmx";
rsExec.Url = "http://localhost/ReportServer/ReportExecution2005.asmx";
byte[] Sendresults = null;
byte[] bytes = null;
string historyID = null;
string deviceInfo = @"<DeviceInfo><Toolbar>False</Toolbar></DeviceInfo>";
string format = "PDF";
string encoding = null;
string mimeType = null;
string extension = null;
REWebService.Warning[] warnings = null;
string[] streamIDs = null;
string _reportName = @"/FIMO GOF Assets Reports/GOF PURCHASE ORDER";
REWebService.ExecutionInfo ei = rsExec.LoadReport(_reportName, historyID);
REWebService.ParameterValue[] parameters = new REWebService.ParameterValue[3];
parameters[0] = new REWebService.ParameterValue();
parameters[0].Name = "MVDI_ID";
parameters[0].Value = lblVendid.Text;
parameters[1] = new REWebService.ParameterValue();
parameters[1].Name = "MBRI_ID";
parameters[1].Value = lblBranch.Text;
parameters[2] = new REWebService.ParameterValue();
parameters[2].Name = "MPDI_DocNo";
parameters[2].Value = lblPOId.Text;
rsExec.SetExecutionParameters(parameters, "en-us");
Sendresults = rsExec.Render(format, deviceInfo, out extension, out encoding, out mimeType, out warnings, out streamIDs);
MemoryStream ms = new MemoryStream(Sendresults);
FileStream stream = File.Create("Asset Module/Reports/PO_Report.PDF");
stream.Write(Sendresults, 0, Sendresults.Length);
stream.Close();
Label lbpath1 = new Label();
lbpath1.Text = "Reports/PO_Report.PDF";
FileInfo f = new FileInfo(Server.MapPath(lbpath1.Text));
System.Diagnostics.Process.Start(@"" + f.FullName + "");
}
catch (Exception Ex)
{
throw Ex;
}
}
#endregion
modified 23-Dec-12 23:58pm.
|
|
|
|
|
Vinay Meka wrote: working fine when i run the project on my local system,but when i hosted it on ISS i'm unable to
This means something is missing on the server which is present on your localsystem. Files or permission.
Vinay Meka wrote: rs.Url = "http://localhost/ReportServer/ReportService2005.asmx";
rsExec.Url = "http://localhost/ReportServer/ReportExecution2005.asmx";
Url expects the local system to have report server. Does the system where you are hosting it has report server installed? It is always good to give proper URL with server name instead of localhost. Like: http://machineServerName/Reportserver
Vinay Meka wrote: FileStream stream = File.Create("Asset Module/Reports/PO_Report.PDF");
You might be having permission error leading to no creation of PDF file.
|
|
|
|
|
Hi
I am getting an error on My asp.net page ONLY ON FIRST LOAD
Could not load file or assembly 'System.Runtime, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.
Line 131: <link rel="Stylesheet" type="text/css" href="~/CSS/DropBoxStyles.css" />
Line 132: <form class="fContent" id="mform" runat="server">
Line 133: <asp:ScriptManager ID="ScriptManager1" runat="server">
Line 134: </asp:ScriptManager>
Line 135: <div id="adminBar" class="AdminTool" runat="server">
Can someone help me with this . it only happens shen i just started the web app , after that if i refresh its fine
Answer only if you have a suggestion on how to fix , I can use google too(didnt help much).
Kind Regards
Chona1171
Web Developer (C#), Silverlight
|
|
|
|
|
are you using IIS or IISExpress ?
plz update
|
|
|
|
|
I cannot exactly figure out how the scroll position is measured.
I have a container with a specific height (400) and some elements (30) in it with specific heights (18). The container displays about 7.2 items in it. The maximum scroll position in firefox is 142. In chrome 141.
If the container can display an exact number of items then the calculation is simple: number-of-items * item-height - container-height.
But how is it calculated if the container displays 7.2 items?
And worse, if the container has padding top and bottom?
See this example[^]
[edit]
The reason why I want this is because I want some kind of ScrollBar. I have it kind of working, but there are differences in browsers.
In firefox, this example works: http://jsfiddle.net/woomla/ma88D/7/[^]
In chrome this example workds: http://jsfiddle.net/woomla/ma88D/8/[^]
The difference is that in the chrome version I need to add padding-top and padding-bottom to the max scroller distance. In firefox I need to add only padding-top.
modified 18-Dec-12 7:05am.
|
|
|
|
|
What about rounding your items count up from 7.2 to 8 ?
And then calculating the height based on that?
|
|
|
|
|
Hi,
I am exploring the best web framework to write a community service like portal. The portal includes components such as Calendar, Membership, Committees,...etc. There are many web frameworks (ASP.net, PHP, Joomla, WordPress, DNN, ...etc). Which is the best web framework/language to write such portal. The website needs to be database driven, secure and easy to maintain. Please give your advise according to your experience.
Regards,
Emad
|
|
|
|
|
You should really look at DotNetNuke.
http://www.dotnetnuke.com/[^]
It is a complete Portal system where you can "plug" new modules in it as your requirements change.
You can download a free version and give it a solid evaluation. There are ISPs which specialize in hosting DNN environment.
I used it at a previous company and was very impressed.
My 2 cents.
|
|
|
|
|
according to my personal experience i will support for PHP because i heard that SQL cant be Mixed up Java oriented web page..i.e., HTML driven sites..but php it is possible it seems but i dont know how it works..because i only developed the websites using HTML
Yamini Achanta
|
|
|
|
|
My vote is for WordPress for what it's worth. It is easier to use than Joomla or Drupal, is database driven, highly customizeable if you can write even a little PHP, HTML or CSS, and a lot of the tedious mind numbing coding is already done so you can concentrate on what you are trying to achieve with the site.
My opinion for what its worth.
jfmorgan333
|
|
|
|
|
Hello,
got a big problem ...
We got a task we cant solve (Obviously, if we could i wouldnt ask here).
Unfortunately we are just allowed to use JavaScript, JSP and JSTL (and HTML of course, we are not allowed to write Java-Code into our HTML-Page.
Our task is:
A page with 2 Textfields and 1 Button.
You shall be able to enter nothing else than numbers in these Textfields (floats or ints, nevermind)
When you enter a value to the last Text Field, there should automatically appear a new Text Field under the others.
So that you can enter as many numbers as you want to.
The button shall sum these numbers.
BUT the sum shall be displayed on another page, and the sum itself shall be calculated on the first page and shall be saved in Beans class.
So, we made 2 pages and one bean.
Numbers.jsp, Sum.jsp and Add (this is the bean)
The Sum.jsp takes the bean and just displays the result.
Thats very easy ...
Our Numbers.jsp generates via JavaScript the new Text-Fields.
Our Problem is, we dont know how to write into the bean from dynamically generated textfields and without pressing a button, because the button shall redirect to Sum.jsp.
Right now we have a workaround ... we reload the page and take the "request.getParametersMap()" and write this into the bean.
But we dont like this idea very much ...
Can anyone help ?
Greetings,
Shera
|
|
|
|
|
So what you want is for us to do your homework for you. That isn't going to happen. You will learn nothing if someone else does this for you.
Make an effort. If you run into problems, post the code specific questions you have here and we'll be more than happy to help.
I wasn't, now I am, then I won't be anymore.
|
|
|
|
|
Well, no i dont want you to do my homework ...
We already spent hours on this task, but we dont find a way to solve it in a proper way.
We just want to know how to save from dynamic generated text fields into a bean.
As far as i know you can use "c:set" just in your HTML-Code.
And ... this doesnt work with autogenerated TextFields, because the JavaScript Code is executed on my WebBrowser(Client-Side) and the Server wont be able to save it into a Bean, because the server doesnt know about these "new" text fields that JavaScript generated.
Server just knows about them if we send a new request, but thats quite "dirty code"
I just want suggestions, if anyone has ...
|
|
|
|
|
I don't know much about Jave and beans, but based on what you said couldn't you put a hidden text field on your page, so your server side is aware of it. Then you can use JavaScript to sum the dynamic fields and store the summed value in the hidden text field and use cset to save the value to your bean.
|
|
|
|
|
Damn it ...
"Why simple, if there's a difficult way"
(German saying )
Thank you, thats a pretty easy way to solve this problem.
Seems as if we had thought too complicated.
|
|
|
|
|
Let me start off by saying that I apologize in advanced if this isn't the correct forum for this question, but there didn't seem to be a forum that exactly matched the question/issue I'm having.
I'm a VB.NET developer and I like to expand by knowledge by trying to program things from scratch that are already implemented ih the.NET framework. My current project is programming a SMTP server using just sockets. I've already read the RFC on SMTP and my company has an Exchange Server (2007) that I was going to use for testing.
The web address of the server is exchange.mycompany.com and I used reverse DNS to get the IP adress. The domain name does have a MX record a well. From the command prompt on my computer (which is running Win7 Professional) I tried using telnet to connect on port 25. I tried using the domain name as well as the IP address, but both times it said it couldn't connect to the server on port 25.
I checked the settings ih Outlook and the port is correct. I then tried connecting on port 110, and some other ones that are sometimes used, and it gave the same error message.
Next I connected to the Exchange server through VPN and tried telnet again on port 25 and this time it worked. However in the SMTP banner it said remote.mycompany.com instead of exchange.mycompany.com. So I disconnected from the VPN and tried the telnet again on all the ports I initially tried but used remote.mycompany.com but again got the same error message. I did an IP address lookup and remote.mycompany.com and exchange.mycompany.com point to the same IP address.
I then used mxtools.com and dnsstuff.com (I think that was the adress) and used their SMTP tools to see of they could connect. I entered mycompany.com as the domain name and they looked up the MX record, which returns exchange.mycompany.com as the SMTP server, and both tools were able to connect with no issues identified.
So my questions: 1) If the MX record list exchange.mycompany.com as the SMTP sever, why does the banner return remote.mycompany.com? 2) Why can't I connect the SMTP server through telnet unless I'm connected through VPN, but the two websites I used to test it the connection worked?
Obviously the server works because because the two websites can connect to it, I can when I'm in VPN, and other servers can because I receive email on my corporate account. What could prevent my computer from connecting to the SMTP server through telnet when I'm not on VPN. I should also mention that I even tried turning off all my anti-virus software to make sure that it wasn't blocking it.
Any help would be greatly appreciated since I assuming if I can't telnet in I most likely wouldn't be able to connect through sockets so I can't start working on my project until I solve this.
Thanks,
Dominick
|
|
|
|
|
Sounds like a network security issue.
vbmike
|
|
|
|
|
Originally I thought that maybe it was because Port 25 is closed on my home router. However, if Port 25 was closed on my router would I still be able to connect while I'm on VPN?
|
|
|
|
|
It is unlikely that you can connect directly from home to your company server through normal internet, as most company exchange servers do not allow connections from outside their intranet. When you use VPN you are, presumably, going via the company's intranet and thus seen as a valid user.
One of these days I'm going to think of a really clever signature.
|
|
|
|
|
I'm not trying to connect to it so I can send an email through the server. What I was trying to understand how to do was to deliver and email to it. For example, if I build an SMTP server and a client which connects to my that SMTP server and I want to send an email to webmaster@mycompany.com (where mycompany.com is hosted on the Exchange server), how would the SMTP server I created connect to the Exchange server in order to deliver the email? Doesn't the Exchange server have to allow some sort of connection from outside the intranet in order to receive emails from other domains (gmail, yahoo, etc.)?
|
|
|
|
|
DisIsHoody wrote: Doesn't the Exchange server have to allow some sort of connection from outside the intranet in order to receive emails Yes, of course it does, but I cannot say why your attempt at connection was rejected. Maybe you should talk to your Exchange administrator for more details on what restrictions the server has.
One of these days I'm going to think of a really clever signature.
|
|
|
|
|
I'm going to have to try and do that, unfortunately the person who set it up is no longer with the company and we just have an outsourced IT company that maintains it and they usually aren't very help fully. However, because the web tools were able to connect to is it reasonable to assume the problem is on my end? I was thinking maybe because I dont have a domain name so if the Exchange server tries to lookup the IP address of my computer there is no MX or PTR record. Is this something SMTP servers look for?
I also found something that I dont know how to explain or how it may affect this. The MX record for the server list exchange.mycompany.com. However, even when I'm on VPN, I can't connect to the SMTP server using that address in telnet or the IP address it points to. I have to use remote.mycompany.com, which is shown in the SMTP banner and points to the SAME IP ADDRESS. Is there a setting in Exchange that makes it script only request coming from this address? If so, how do the online SMTP tools discover this subdomain when I only gave the tools the domain name (mycompany.com) and the MX record only shows exchange.mycompany.com? The address remote.mycomany.com is not located anywhere in the zone file.
|
|
|
|
|
I'm afraid you are getting deep into the Exchange server now, which is not something I have worked with.
One of these days I'm going to think of a really clever signature.
|
|
|
|
|
Okay thanks...I'm going to move this thread over to the Hosting/Server forum. Hopefully someone familiar with Exchange will be able to figure this out. I appreciate your help thus far.
|
|
|
|
|
We use XSLT to convert various XML files into tab delimited.
Some of the XML input files have a variable number of options. Sometimes none, others 1,2,3 or more.
This makes the formatting difficult since there is also a header row that is created in the XSLT file that must have the exact number of columns and proper header context.
So the question is how to get this formatted correctly since if we provide for 2 sets of opts (from the W3Schools tryit) in the header row how to get the for-each to stop at 2.
<cd>
<title>Eros</title>
<artist>Eros Ramazzotti</artist>
<country>EU</country>
<company>BMG</company>
<price>9.90</price>
<year>1997</year>
</cd>
<cd>
<opts length="3">
<opt><name>Nm1</name><val>111</val></opt>
<opt><name>Nm2</name><val>222</val></opt>
<opt><name>Nm3</name><val>333</val></opt>
</opts>
Typical for-each
<xsl:for-each select="opts/opt">
<td><xsl:value-of select="name"/></td>
<td><xsl:value-of select="val"/></td>
</xsl:for-each>
In this case there will be 3 sets of opts but 2 sets of headers and all data after this will be off.
Tried using xls:when test="@length =...' but don't see a way of just getting 2 of the 3 opts.
Can anyone help?
Thanks
|
|
|
|