|
|
ReportDocument rpt=new ReportDocument();
rpt.Load(Server.MapPath("ReqVsCur.rpt"));
rpt.SetDatabaseLogon("username","password");
rpt.SetParameterValue("@year",DateTime.Now.Year);
MemoryStream oStream;
oStream=(MemoryStream)rpt.ExportToStream(CrystalDecisions.Shared.ExportFormatType.Excel);
Response.Clear();
Response.Buffer=true;
Response.ContentType="application/vnd.msexcel";
Response.BinaryWrite(oStream.ToArray());
Response.End();
|
|
|
|
|
Respected Gurus
I am developing in asp.net1.1 and crystalreports.
I have some reports,developed in crystal reports which i have to export to excel.
Public Sub exportfinalreport()
Dim oStream As New MemoryStream ' // using System.IO
'this contains the value of the selected export format.
showfinalreport(dtReportdate)
oStream = rpt.ExportToStream(CrystalDecisions.Shared.ExportFormatType.Excel)
Response.Clear()
Response.Buffer = True
Response.ContentType = "application/vnd.ms-excel"
Try
Response.BinaryWrite(oStream.ToArray())
Response.End()
Catch err As Exception
Response.Write("< BR >")
Response.Write(err.Message.ToString)
End Try
End Sub
The above code successfully export data to excel.
But problem is look and feel.
Data in excel does not come under their corresponding headers,
which creates confusion.
Is there a better way to export to excel with a good look and feel.
|
|
|
|
|
Hi friends.....
i am create a data access layer using "Dataset.XSD". While retrieve and inserting date using objectdatasource I have problem with sqlserver.i got the exception “Login failed for user 'MY-PC\ASPNET'.(here my-pc is my system name).when i used sqldatasource i can acess the data.how can i handle the exception
|
|
|
|
|
check out your Sql Connection String.
best regard
pathan
|
|
|
|
|
hello !!
I have a project with me .. A namespace has 6 ".cs" files and I want to create a dll for that namespace and add to the project
As I have updated one of the .cs file now when I build the project and when i look into the dll , it does not shows any newly created dll .. why is it so . how can add a updated dll. plz hlp me out
Mrinal
|
|
|
|
|
If is web application then dll is not created by default you need to publish the your application or precompile is another option
please google the web for creating dll for web application thats how you will learn more
Thanks and Regards
Sandeep
If If you look at what you do not have in life, you don't have anything,
If you look at what you have in life, you have everything... "
|
|
|
|
|
Hi to all,
i have one problem with datagrid control. i m doing connectivity with vs.net 2005.when i fill dataset with fill() method it will generate sql exception
so tell me the solution.
Mogha Ritesh
|
|
|
|
|
Mogha Ritesh wrote: i fill dataset with fill() method it will generate sql exception
What was the exception ?
|
|
|
|
|
Hi,
Can any body tell me how to convert the asp.net user control along with it's resource file ex localization and other class files that it is using and the ascx page to a single dll??
Help Appritiated.
Do not forget to tune the Performance
Sudhir Yadav
|
|
|
|
|
Sudhir Yadav wrote: scx page to a single dll??
When you build the project which contains ASCX files, DLL will be created automatically. But to use this you need to supply the ASCX files and resource files. If you want all in a single assembly, go for Custom server controls.
|
|
|
|
|
Thanks Navneet
But i thought that there be any other solution other then custom control. Actually i was trying to avoid lengthy code to write composite controls.
If there i anything else that you know please tell.
Do not forget to tune the Performance
Sudhir Yadav
|
|
|
|
|
hello !!
I have a project with me .. A namespace has 6 ".cs" files and I want to create a dll for that namespace and add to the project
:-
I am already having dll added but i have updated one of the .cs file now when I build the project and when i look into the dll , it does not shows any newly created dll .. why is it so . how can add a updated dll . plz hlp me out
Mrinal
|
|
|
|
|
Dll will be created by the name of Application i think
is it wen application or class library
check the details it will override the existing one with same name so check the detials of that dll
Thanks and Regards
Sandeep
If If you look at what you do not have in life, you don't have anything,
If you look at what you have in life, you have everything... "
|
|
|
|
|
I don't find any other alternative. That's the way how ASCX files works. It's a replacement for include files in classical ASP. It needs the ASCX files to be present in the requested path. In ASP.NET 2.0 comes with WebResource concept, which allows you to embed the resources and access it with a temporary URL. I don't how much this is helpful in ASCX files. i successfully implemented that in Custom Server controls
|
|
|
|
|
Ok, thanks Navneeth,
Mean while i am trying the WebResource method of yours. Let's see what happens. I'v never done that before, so if i am having any trouble. I will bother you again bro.
Bi 4 now
Do not forget to tune the Performance
Sudhir Yadav
|
|
|
|
|
|
Hi JON,
Thanks for your concern. Yes, i have already tried that method of using the user control. Creating the UC to DLL using web setup but when i reference that dll into different project it gives compile time error that dll not found for the one which i had added manually in the aspx file. If you have something to say, you are welcome.
Also, i wanted to add the language resourse and other file into that dll so that it's a single unit all together. Is that possible?
Do not forget to tune the Performance
Sudhir Yadav
|
|
|
|
|
hi,
i have created a asp.net application using c#.net. i have used tables to position controls in the form. but in some systems its losing the position of the controls while running the website. i dont know how its happening. if any body have solution for this, please send to me. its very urgent!!!!
|
|
|
|
|
Check for any inline styles present for the controls. This might be the problem. VS2005 editor automatically adds inline styles to the controls.
|
|
|
|
|
but in this case all the controls are displaying scattered. how can i check the inline styles
|
|
|
|
|
Take source of the page(HTML) and check whether any styles are added to the control tag. Try removing that. What is your outer table's width ? If you want page to be fit on all resolutions, width should be mentioned in percentage.
|
|
|
|
|
following is the sample of one of my controls (HTML) and my outer tables width is 100px
<asp:label id="Label2" runat="server" font-bold="True" style="z-index: 100; left: 33px;
position: absolute; top: 52px" text="Select a date" width="105px">
-- modified at 1:37 Friday 12th October, 2007
|
|
|
|
|
Do one thing Copy source code of your page i.e html content out that in html editor like vs2005 then check the html is properly coded
i think there might be some missing closing tags in your page check that
Thanks and Regards
Sandeep
If If you look at what you do not have in life, you don't have anything,
If you look at what you have in life, you have everything... "
|
|
|
|
|
i have checked the html codes and the coding is correct. its working properly in the localhost. but when i host the page, its displaying scattered in some client machines.
|
|
|
|