Showing posts with label visual. Show all posts
Showing posts with label visual. Show all posts

Thursday, March 29, 2012

Exporting Reports

I need some urgent advice. I used Crystal Reports 4.6 (distributed with Visual Studio 6) and designed a report containing saved data. By default the report prints to a window (Crystal Report Preview Window) from where the users can select to print the report to their printers. I need to remove the export and mail options from the Preview Window.
I understand that the later, more recent versions, of Crystal Reports allows for the export and mail buttons to be hidden, what about the version I have? Due to the fact that Crystal Reports 4.6 apparently does not facilitate for this function I considered moving the report to MS Data Report, but it contains export abilities as well. I am more than prepared to use either of the 2 as long as I know that the information contained within the report cannot be tampered with by way of file exports.
Can anybody please help me with this problem?I don't know anything about version 4.6, but maybe there's a way that you can trap the Export button being pushed and warn the user, then exit the function before the report is exported?|||I tried trapping it from within VB, but to no avail.

Wednesday, March 21, 2012

Exportin table in xml file

Hello everyone,
I need to save data into an xml file. Now I do this with Visual Basic using
the ado-recordset method 'Save'. I'd like to do this task with a sql server
stored procedure.
Does anyone know if it is possible, and how?
--
Thank you everyoone,
Walker BohYou could do something like
EXEC master..xp_cmdshell "OSQL -E -S -Q"Select * from table for xml
' -od:\FTPresentation\imagefmt.fmt'
Wayne Snyder, MCDBA, SQL Server MVP
Mariner, Charlotte, NC
www.mariner-usa.com
(Please respond only to the newsgroups.)
I support the Professional Association of SQL Server (PASS) and it's
community of SQL Server professionals.
www.sqlpass.org
"Walker Boh" <WalkerBoh@.discussions.microsoft.com> wrote in message
news:F1F0C715-25E3-4337-99E6-4CF4F0DDEF49@.microsoft.com...
> Hello everyone,
> I need to save data into an xml file. Now I do this with Visual Basic
using
> the ado-recordset method 'Save'. I'd like to do this task with a sql
server
> stored procedure.
> Does anyone know if it is possible, and how?
> --
> Thank you everyoone,
> Walker Boh|||It doesn't work as I need. It doesn't create an xml file that I can open wit
h
IE for example, nor it has tha same structure the recordset methis save
create.
thank you anyway
"Wayne Snyder" wrote:

> You could do something like
> EXEC master..xp_cmdshell "OSQL -E -S -Q"Select * from table for xml
> ' -od:\FTPresentation\imagefmt.fmt'
>
> --
> Wayne Snyder, MCDBA, SQL Server MVP
> Mariner, Charlotte, NC
> www.mariner-usa.com
> (Please respond only to the newsgroups.)
> I support the Professional Association of SQL Server (PASS) and it's
> community of SQL Server professionals.
> www.sqlpass.org
> "Walker Boh" <WalkerBoh@.discussions.microsoft.com> wrote in message
> news:F1F0C715-25E3-4337-99E6-4CF4F0DDEF49@.microsoft.com...
> using
> server
>
>

Exportin table in xml file

Hello everyone,
I need to save data into an xml file. Now I do this with Visual Basic using
the ado-recordset method 'Save'. I'd like to do this task with a sql server
stored procedure.
Does anyone know if it is possible, and how?
Thank you everyoone,
Walker Boh
You could do something like
EXEC master..xp_cmdshell "OSQL -E -S -Q"Select * from table for xml
' -od:\FTPresentation\imagefmt.fmt'
Wayne Snyder, MCDBA, SQL Server MVP
Mariner, Charlotte, NC
www.mariner-usa.com
(Please respond only to the newsgroups.)
I support the Professional Association of SQL Server (PASS) and it's
community of SQL Server professionals.
www.sqlpass.org
"Walker Boh" <WalkerBoh@.discussions.microsoft.com> wrote in message
news:F1F0C715-25E3-4337-99E6-4CF4F0DDEF49@.microsoft.com...
> Hello everyone,
> I need to save data into an xml file. Now I do this with Visual Basic
using
> the ado-recordset method 'Save'. I'd like to do this task with a sql
server
> stored procedure.
> Does anyone know if it is possible, and how?
> --
> Thank you everyoone,
> Walker Boh
|||It doesn't work as I need. It doesn't create an xml file that I can open with
IE for example, nor it has tha same structure the recordset methis save
create.
thank you anyway
"Wayne Snyder" wrote:

> You could do something like
> EXEC master..xp_cmdshell "OSQL -E -S -Q"Select * from table for xml
> ' -od:\FTPresentation\imagefmt.fmt'
>
> --
> Wayne Snyder, MCDBA, SQL Server MVP
> Mariner, Charlotte, NC
> www.mariner-usa.com
> (Please respond only to the newsgroups.)
> I support the Professional Association of SQL Server (PASS) and it's
> community of SQL Server professionals.
> www.sqlpass.org
> "Walker Boh" <WalkerBoh@.discussions.microsoft.com> wrote in message
> news:F1F0C715-25E3-4337-99E6-4CF4F0DDEF49@.microsoft.com...
> using
> server
>
>

Exportin table in xml file

Hello everyone,
I need to save data into an xml file. Now I do this with Visual Basic using
the ado-recordset method 'Save'. I'd like to do this task with a sql server
stored procedure.
Does anyone know if it is possible, and how?
--
Thank you everyoone,
Walker BohYou could do something like
EXEC master..xp_cmdshell "OSQL -E -S -Q"Select * from table for xml
' -od:\FTPresentation\imagefmt.fmt'
Wayne Snyder, MCDBA, SQL Server MVP
Mariner, Charlotte, NC
www.mariner-usa.com
(Please respond only to the newsgroups.)
I support the Professional Association of SQL Server (PASS) and it's
community of SQL Server professionals.
www.sqlpass.org
"Walker Boh" <WalkerBoh@.discussions.microsoft.com> wrote in message
news:F1F0C715-25E3-4337-99E6-4CF4F0DDEF49@.microsoft.com...
> Hello everyone,
> I need to save data into an xml file. Now I do this with Visual Basic
using
> the ado-recordset method 'Save'. I'd like to do this task with a sql
server
> stored procedure.
> Does anyone know if it is possible, and how?
> --
> Thank you everyoone,
> Walker Boh|||It doesn't work as I need. It doesn't create an xml file that I can open with
IE for example, nor it has tha same structure the recordset methis save
create.
thank you anyway
"Wayne Snyder" wrote:
> You could do something like
> EXEC master..xp_cmdshell "OSQL -E -S -Q"Select * from table for xml
> ' -od:\FTPresentation\imagefmt.fmt'
>
> --
> Wayne Snyder, MCDBA, SQL Server MVP
> Mariner, Charlotte, NC
> www.mariner-usa.com
> (Please respond only to the newsgroups.)
> I support the Professional Association of SQL Server (PASS) and it's
> community of SQL Server professionals.
> www.sqlpass.org
> "Walker Boh" <WalkerBoh@.discussions.microsoft.com> wrote in message
> news:F1F0C715-25E3-4337-99E6-4CF4F0DDEF49@.microsoft.com...
> > Hello everyone,
> >
> > I need to save data into an xml file. Now I do this with Visual Basic
> using
> > the ado-recordset method 'Save'. I'd like to do this task with a sql
> server
> > stored procedure.
> > Does anyone know if it is possible, and how?
> > --
> > Thank you everyoone,
> > Walker Boh
>
>

Monday, March 19, 2012

export with a webservice

Hi,
I have created an application with VIsual Studio.NET in C#. I used a
webservice in order to view my reports.
I want export my report in format that I want with this application.
How can I do? What is the solution?I've done this by putting into a dropdownlist the available export formats
for a particular report. then when i go to render the report i have the
following code:
try
{
report =rs.Render(reportPath,format,historyID,devInfo,parameters,credentials,showHideToggle,out
encoding, out mimeType, out optionalParams, out optionalWarnings, out
streamIDs);
switch(format)
{
case "PDF":
Response.ClearContent();
Response.AppendHeader("content-length", report.Length.ToString());
Response.ContentType = "application/pdf";
Response.BinaryWrite(report);
Response.Flush();
Response.Close();
break;
case "CSV":
Response.ClearContent();
Response.AppendHeader("content-length", report.Length.ToString());
Response.ContentType = "application/vnd.ms-excel";
Response.BinaryWrite(report);
Response.Flush();
Response.Close();
break;
case "EXCEL":
Response.ClearContent();
Response.AppendHeader("content-length", report.Length.ToString());
Response.ContentType = "application/vnd.ms-excel";
Response.BinaryWrite(report);
Response.Flush();
Response.Close();
break;
default:
Label1.Text = System.Text.Encoding.Default.GetString(report);
break;
}
}
catch (SoapException se)
{
Console.WriteLine(se.Detail.OuterXml);
}
"r388042" wrote:
> Hi,
> I have created an application with VIsual Studio.NET in C#. I used a
> webservice in order to view my reports.
> I want export my report in format that I want with this application.
> How can I do? What is the solution?|||Thanks you!!!
It's run very good!!!
Do you know how we can do in order to export in XML or TIFF?

Wednesday, March 7, 2012

Export to Exel

I am newbie in exporting data.

i am using visual studio.net 2003 and using vb.net to create a webapplication.

My problem is how do i query my data from MS-SQL and export to microsoft Exel??

Can some one gave me the sample code?

Thanks

I had success to export my data to exel,

but why must i save the file before i open it??

Can anyone help me solve this problem??

My coding is Below :

Dim

rAsNew Columnar_Landed

r.SetDatabaseLogon("username", "password", "192.xxx.xxx.xxx,xx", "DTZ-VMS")

r.RecordSelectionFormula = query

Dim oStreamAsNew MemoryStream

oStream = r.ExportToStream(CrystalDecisions.Shared.ExportFormatType.ExcelRecord)

HttpContext.Current.Response.Clear()

HttpContext.Current.Response.Buffer =

True

HttpContext.Current.Response.ContentType = "application/vnd.ms-excel"

HttpContext.Current.Response.BinaryWrite(oStream.ToArray())

HttpContext.Current.Response.End()

|||

Please search the forum. You will find a lot of material on it. Search by "Gridview to excel". one important link is:

http://forums.asp.net/thread/1573815.aspx

Please mark this post as resolved if you r done

Sunday, February 26, 2012

Export to excel from report manager problem

When i use export from report manager to excel for some reason it gave us
that error
but one thing more i used open that report using visual studio on my friend
computer and then preview the report and then select save as excel file . it
didnt give me error but when i use report manager and then try to export to
excel has that error
Microsoft Excel File Repair Log
Errors were detected in file C:\test.xls'
The following is a list of repairs:
Damage to the file was so extensive that repairs were not possible. Excel
attempted to recover your formulas and values, but some data may have been
lost or corrupted.Hello Amjad.
I've seen this before. This happened when i had certain formulas in my
report, either in text boxes or in a chart. Are you using any complex
formulas? If you are, take them out temporarily, and try to export the
file. Let me know if it works.
Amjad wrote:
> When i use export from report manager to excel for some reason it gave us
> that error
> but one thing more i used open that report using visual studio on my friend
> computer and then preview the report and then select save as excel file . it
> didnt give me error but when i use report manager and then try to export to
> excel has that error
> Microsoft Excel File Repair Log
> Errors were detected in file C:\test.xls'
> The following is a list of repairs:
> Damage to the file was so extensive that repairs were not possible. Excel
> attempted to recover your formulas and values, but some data may have been
> lost or corrupted.|||Thanks
Yeah i was using a two charts but for certain reason for one year as year
was my parameter did give me any error and for another year data it gave me
error to open affter export. then i removed the chart and after that it didnt
actually i was using two chart , removing either of one solved the problem
but i need to include these chart back but due to that problem i removed it
temprarly....
Do you have any solution or any hot fix availabe to solve this problem.
because on of my friend computer it did export from visual studio preview
option not from report manager but on my computer it did not export both from
visual studio and report manager. it seem that his computer got some updates
for visual studio that i am missing thats why its giving me that problem even
from visual studio preview option. so if we find that hotfix so i can install
both on report manager server and my local computer...
"KevinGreen24@.gmail.com" wrote:
> Hello Amjad.
> I've seen this before. This happened when i had certain formulas in my
> report, either in text boxes or in a chart. Are you using any complex
> formulas? If you are, take them out temporarily, and try to export the
> file. Let me know if it works.
>
> Amjad wrote:
> > When i use export from report manager to excel for some reason it gave us
> > that error
> > but one thing more i used open that report using visual studio on my friend
> > computer and then preview the report and then select save as excel file . it
> > didnt give me error but when i use report manager and then try to export to
> > excel has that error
> >
> > Microsoft Excel File Repair Log
> >
> > Errors were detected in file C:\test.xls'
> > The following is a list of repairs:
> >
> > Damage to the file was so extensive that repairs were not possible. Excel
> > attempted to recover your formulas and values, but some data may have been
> > lost or corrupted.
>|||OK. Put the charts back in, and try to export again.
I'm not exactly sure of any hotfixes right now. If there's any service
packs / patches out there for MSRS 2005 you should install them. But
I'm not positive there are any. I'm sorry I couldn't be of more help.
Amjad wrote:
> Thanks
> Yeah i was using a two charts but for certain reason for one year as year
> was my parameter did give me any error and for another year data it gave me
> error to open affter export. then i removed the chart and after that it didnt
> actually i was using two chart , removing either of one solved the problem
> but i need to include these chart back but due to that problem i removed it
> temprarly....
> Do you have any solution or any hot fix availabe to solve this problem.
> because on of my friend computer it did export from visual studio preview
> option not from report manager but on my computer it did not export both from
> visual studio and report manager. it seem that his computer got some updates
> for visual studio that i am missing thats why its giving me that problem even
> from visual studio preview option. so if we find that hotfix so i can install
> both on report manager server and my local computer...
>
> "KevinGreen24@.gmail.com" wrote:
> > Hello Amjad.
> >
> > I've seen this before. This happened when i had certain formulas in my
> > report, either in text boxes or in a chart. Are you using any complex
> > formulas? If you are, take them out temporarily, and try to export the
> > file. Let me know if it works.
> >
> >
> > Amjad wrote:
> > > When i use export from report manager to excel for some reason it gave us
> > > that error
> > > but one thing more i used open that report using visual studio on my friend
> > > computer and then preview the report and then select save as excel file . it
> > > didnt give me error but when i use report manager and then try to export to
> > > excel has that error
> > >
> > > Microsoft Excel File Repair Log
> > >
> > > Errors were detected in file C:\test.xls'
> > > The following is a list of repairs:
> > >
> > > Damage to the file was so extensive that repairs were not possible. Excel
> > > attempted to recover your formulas and values, but some data may have been
> > > lost or corrupted.
> >
> >