Skip to main content

Can anyone please give me an example of export to excel using Visual COBOL in asp web forms ?


#extend9.2.5VisualCOBOL
#ASP.Net
#FormVisualCobol

Can anyone please give me an example of export to excel using Visual COBOL in asp web forms ?


#extend9.2.5VisualCOBOL
#ASP.Net
#FormVisualCobol

Can you please be more specific? What is it that you want to export to Excel, a file, a control like a grid, create a new spreadsheet and populate it with data?

What is it that you wish to accomplish?

Thanks.


Can anyone please give me an example of export to excel using Visual COBOL in asp web forms ?


#extend9.2.5VisualCOBOL
#ASP.Net
#FormVisualCobol

Hi Chris,

I want to create a new spreadsheet filled with the data, that i have populated on the screen using an asp repeater.

Thanks


Can anyone please give me an example of export to excel using Visual COBOL in asp web forms ?


#extend9.2.5VisualCOBOL
#ASP.Net
#FormVisualCobol

I found a couple articles that show how to export the data in a Repeater to an excel spreadsheet. You could also use a manual method such as the one found here but this seems to provide a simple way of doing this,

Assuming that you have a button called ExportToExcel on your form the following code will allow you to save the data to an Excel file format in its click method:


Can anyone please give me an example of export to excel using Visual COBOL in asp web forms ?


#extend9.2.5VisualCOBOL
#ASP.Net
#FormVisualCobol

Hello Chris,

Firstly sorry for the late reponse. I tried this but was unsuccessful in achieving it. I get COBCH0845 for StringWriter.


Can anyone please give me an example of export to excel using Visual COBOL in asp web forms ?


#extend9.2.5VisualCOBOL
#ASP.Net
#FormVisualCobol

A COBCH0845 error means that the class is not found. Since StringWriter is a .NET class you should Google the MSDN documentation to see what namespace and assembly that it resides in.

Namespace:   System.IO

Assembly:mscorlib (in mscorlib.dll)

Since StringWriter is in the System.IO namespace you need to add an ilusing"System.IO" directive in order to reference the name StringWriter without using System.IO.StringWriter.

mscorlib.dll should be referenced automatically.


Can anyone please give me an example of export to excel using Visual COBOL in asp web forms ?


#extend9.2.5VisualCOBOL
#ASP.Net
#FormVisualCobol

Hello Chris,

That worked! But have got a problem now , which I was trying to fix but failed to. I am just getting an empty spreadsheet each time i do the export.


Can anyone please give me an example of export to excel using Visual COBOL in asp web forms ?


#extend9.2.5VisualCOBOL
#ASP.Net
#FormVisualCobol
[deleted]

Can anyone please give me an example of export to excel using Visual COBOL in asp web forms ?


#extend9.2.5VisualCOBOL
#ASP.Net
#FormVisualCobol

Hello Yasminpriya,

Thanks for your response, but that is not exactly what i need as it is in C#.