Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  HOME    TRACKER    Visual Basic

To Export Datareport To Excel

i want to export datareports to excel. is there any way one can do it. at present the export button in datareport is exporting only to html and txt files . can we export it to excel sheets .pl help immdly
with regards

View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
Export Datareport To Excel
I am on a mission to find out the best way to export a data report to excel after the report has been made. Right now you can push a little button on top of the data report to export it to html, how do I do the same for excel? I have it written now to export to excel but it starts this process as soon as the report is made. It has been added to the AddExportReport function which is called by the DataReport_Activate function. How do I, or can I add a button to the report to export after the report is done? and on user discression, not when the report comes up.

Any ideas?

Datareport Export To Excel.
Hi Guys,

I am using a Datareport in my application. I want to know how to export the report directly to Excel. Please help guys. Very urgent.

Failed To Export The Report, Error In MS Excel Export Format DLL

I have a little problem with Crystal Reports (CR 8) :

I try to export one of my reports from a VB program. When I try to export it in "Comma Separated Values" format everything is ok (except this is not the format I need
). When I try to export it in excel format it works, on some PCs but not on others ?

VB code sample :

rpt.ExportOptions.FormatType = crEFTExcel80Tabular
rpt.ExportOptions.DestinationType = crEDTDiskFile
rpt.ExportOptions.UseReportDateFormat = True
rpt.ExportOptions.UseReportNumberFormat = True
rpt.ExportOptions.DiskFileName = txtExportDirectory.Text & ExportName
rpt.Export False

I tried all the excel formats (crEFTExcel50, crEFTExcel50Tabular, crEFTExcel70 ...) but on some PC's I always get the "Exporting Records" window for a second and then the error "Failed to export the report, Error in MS Excel Export Format DLL".

Can anyone help me out ?
Thanks !

Export DataReport To .pdf?
Can I export my DataReport to .pdf? I can export to html :

DataReport1.ExportReport rptKeyHTML, "C:MyReport.htm", True, True, rptRangeFromTo, 1, 4

Can I export to .pdf?

Export DataReport To Pdf?
Can I export my DataReport to .pdf? I can export to html :

VB Code:
DataReport1.ExportReport rptKeyHTML, "C:MyReport.htm", True, True, rptRangeFromTo, 1, 4

Can I export to .pdf?

Help... Export Datareport
when my datareport is produced.. I sometimes need to export it. (using export button on datareport screen) However.. no matter what type I choose to save it as .. the format of the report gets totally screwed up. what can I do

Export To Csv From Datareport
I would like to export a report as csv format which i have created with datareport function in VB 6.0. Is there a way to add export as csv option to datareport utility or do you know any free utility that i can use with VB?


Export DataReport
Iam building my reports using DataReports in my VB project.i would like to export my DataReport to Excel is this possible.plz mail me the code.
thank u

Export Datareport To MS Word

Can I export a datareport created in VB 6.0 to a word document in the same format the datareport is created. If yes the can anyone give me the code for that. Please it is urgent

The reason is the person is going to attach the doc file with his email.

Thanx in advance


Disable Export In Datareport
Hi there,

Is there a way to disable Export option in Datareport?


DataReport Export Images

My data report have text fields and some images (pictures).
When I export contents of datareport to rtf or html I have only text fields without images.
Does enyone now how to export images from datareport?


How To Export The DataReport To Well Designed HTML
I exported the data report to a html file.
but the alignment is not the same as i designed in the reports.
i want the same aligment and the shapes which i included in the report.

how can i?


Datareport Disable Export Button
How can I disable the Export button that is displayed when previewing a datareport? I want my users to be able to preview & print but not export the datareport.
Thanks in advance...

Restrict Print,Export In VB DataReport
Anyone know how to restrict or disable print or export or both print and export function in VB DataReport? I would like to restrict the print and export feature during priviewing the report. Thanks.

Datareport - HTML Export - Images
I create a datareport and successfully preview/print the image in a rptImage control.

When I export the report as HTML I loose the image.

Is there anyway I can overcome this?

[ask]how To Export Datareport Into Word Document
when I export into html, it only export the text but not pictures.

is there any way to export datareport to *.doc, with all the content inside the datareport exported.

Export DataReport To Word Format
Hellooo Friends...........

I m working with Visual Basic 6.0 Access as Database . I have created a dataReport and now i want to export that report into word format. In export option of datareport viewer there r only HTML and text format i want to eaxactly copy the report into word document.

Datareport Print & Export Buttons
Dear Tek-Tips,

Is there a way that I can hide the Print and Export bottons at the top of a DataReport before I envoke the .Show method. I thought I read this somewhere, however I do not remember where.

Any and all help is always appreciated.

Thank you,

Tom (maxflitom)

How To Disable DataReport Export Button On Toolbar
i would like to disable export function on toolbar, somebody can tell me how to do it. thanks!

How To Disable Or Hide Datareport Export Buton ?
Hi All!

I want to know how to disable or hide datareport export buton ?

please i need this.

Thank's before.

Datareport Export To Html Format Error
when i use the built in export function to export datareport to html, the format is not as same as what i preview? Can anyone help....i am a student....

DataReport Export To HTML - Orientation Problem
How to force DataReport to correctly export portrait oriented page ? Exported page contains all data but in landscape orientation !!!

Exporting An Access Table To A New Excel SS And Open Excel File Afetr Export

Can some help me with writing the code to Export a table from Acces into a new excel spreadsheet, then open an instance of excel to view the newly exported table? I can get the file to export but I am having trouble with the code to open Excel, thanks for you help. See code below..

Private Sub Command26_Click()

DoCmd.TransferSpreadsheet transfertype:=acExport, _
        tablename:="newreqtable", _
        FileName:="F:UserdataSelectionData.xls", hasfieldnames:=True, _
MsgBox "Export is Complete", vbOKOnly, "Selection Data Export"

MsgBox "Your new file is located on F:UserdataSelectionData.xls", vbOKOnly, "Data Export Location"

'This is where I need to have excel open the file for the client.

End Sub

Import Excel Into Flex Grid And Export It Back To Excel.
Hi, i want to make a program that can import the excel files into vb's flex grid or maybe a few textboxs.

then do some modifying and then export it back to the excel format.

the reason i want to have these functions is because i have an existing excel spreadsheet with a large number of infos. and i dont really want to reinput is again into teh new system (if i build it with vb+access db). and was thinkning why not straight away make the vb program import and export the file.

and why want to edit it in excel? wouldnt it be better ot do it in MSExcel itself?
well, the user is not me. the user wants to do something pretty much impossible for excel to do, and the user want a few things fixed. so it would be good to have a new simple coded program for the user to use.

Excel Export Wont Work With Excel XP?
I've got a little app that crunches some numbers and then exports the data to an excel file. It works on Excel 2000 which is the only Excel I have so I wasn't able to test it on any others. I've recently been informed that it doesn't export to Excel XP (it will create the sheets and name them properly, but wont put any data in the cells). My first thought was that I must have included something in my references specific to my Excel version but theres nothing in there labled as Office or Excel.

One other piece of possibly important info: When the export process starts, my app does not create an excel file but instead simply copies an existing xls file (always copies the same empty xls file), renames it, and starts putting data in it. I made the excel file with Excel 2000.

I can only think of using ADOX but that will be a major rewrite and I'd like to avoid that if I could.

Any help would be appreciated. Thanks.

Export Textfile To Excel Without Excel Application
Hi guys,

Newbie here. I created a program that will export the data to excel. It works on my development PC (win98) since i have an excel application there. Now, my problem is when i installed the program in a PC with MS XP without any ms office application, it seems like it wont even save the excel file. Do i need to install the excel application? I wont even open the file on the XP PC, i'll open it in a different PC with an MS office application. Do i need to register excel8.olb on the XP PC?

thanks a lot

Export To Excel
Dear Programmers

I am making a query, the results apear in a list, but I also must export to excel, anyone knows how to do it, and If i have to use any component?

Sql = ""
Sql = Sql & " select * from tabelclient"

Sql = Sql & " order by nome "

Set Dados = Banco.OpenRecordset(Sql, dbOpenSnapshot)

Do While Not Dados.EOF

lstNome.AddItem Dados!Nome
lstNome.ItemData(lstNome.ListCount - 1) = Dados!código


lets say after the query in the list apear the names


how can I expor to excel?

Thank you so much

sorry - I didnt mention, I want to expot from Vb to Excel

Export To Excel
Dear friends.
I'm using this code to put data in XLS format:
Private Sub Command2_Click()

Dim objXL As Excel.Application
Dim objWkb As Excel.Workbook
Dim objSht As Excel.Worksheet
Dim intLastCol As Integer
Dim conWkbName As String

Const conMaxRow = 20000
Const conShtName = "My Custom Sheet"

Set objXL = New Excel.Application
With objXL

.Visible = True

Set objWkb = .Workbooks.Add

On Error Resume Next
Set objSht = New Excel.Worksheet
If Not Err.Number = 0 Then
Set objSht = objWkb.Sheets(1)
objSht.Name = conShtName
End If
On Error GoTo 0
intLastCol = objSht.UsedRange.Columns.Count
With objSht
.Range("A1").FormulaR1C1 = "Extreme VB"

End With

End With
End Sub
This code is OK, but I want to save the file automaticaly, not show the file.

Who can help me.

Thanks one more time!

Excel Export
Hey guys, i did try looking at the forum and actually found some nice tutorials but what i really want to do i didnt found yet.
So, i have an existing excel file, i need to open it, and write some data in a sheet and leave it opened. After the user close it, i dont want the changes to be saved...

any help woud be apreciated

Export To Excel
how do i export a report to excel directly as soon as u press the "View report" button, say. i do not want it to b shown in crystal reports, but directl to excel.

Export To Excel
I need to export an access table into an existing spreedsheet in a specified range. (sheet 1 starting at G7).

Tried the transferspreedsheet, but won't allow range.


Export To Excel
Anyone know how to export the contents of a dbgrid to excel? I am trying to print from a dbgrid and it sucks!


I'm out of my mind, but feel free to leave a message

Export To Excel Row By Row
Hi, I have an Access db that's exporting a recordset to a corresponding Excel sheet based on the value in the Chain field, which is working fine. For example, if there are records in my query with a chain of ABC, those records are exported to the ABC Excel sheet. However, when they're exported, they're put into the row of the Excel sheet as they appear in the query. So if chain ABC has records in rows 8, 9 and 10 of the query, it's exported to the ABC Excel sheet in rows 8, 9 and 10. I want it to be exported to rows 1, 2 and 3. Below is my code.

query = "SELECT * FROM qryDailySales ORDER by [Sale Date]"

Set DBase = CurrentDb
Set RecSet = DBase.OpenRecordset(query, dbOpenForwardOnly)

'Adds new sales data to each corresponding Excel sheet
With RecSet
lngRow = 1
Do While Not .BOF And Not .EOF
strChain = RecSet.Fields.Item("Chain").Value
Set xlSheet = appExcel.Worksheets(strChain)
lngRow = lngRow + 1
For lngCol = 0 To .Fields.Count - 1
xlSheet.Cells(lngRow, lngCol + 1) = .Fields(lngCol)
Next lngCol
End With
Thanks in advance for any help!

Export To Excel
do anybody have any idea for the excel cell how many characters can it continue??
when i was trying to export my crystal report 8.0 to excel then my value was truncated as it was over 255 characters???

pls advice

thanks in advance

Export Excel
Could someone suggest to me why my code wont export to excel? everytime i just get a blank spreadsheet and I'm going mad staring at this screen. Cheers guys

vb Code:
Private Sub Command1_Click()Dim ObjExcel2 As Object: Dim i As IntegerSet ObjExcel2 = CreateObject("excel.sheet")ObjExcel2.application.Visible = False    ObjExcel2.application.cells(1, 1).Value = Label3.Caption    ObjExcel2.application.cells(1, 2).Value = Label4.Caption    ObjExcel2.application.cells(1, 3).Value = Label6.Caption    ObjExcel2.application.cells(1, 4).Value = Label11.CaptionFor i = 1 To (j - 1)    ObjExcel2.application.cells((i + 1), 1).Value = LabelType(i).Caption    ObjExcel2.application.cells((i + 1), 2).Value = LabelMotor(i).Caption    ObjExcel2.application.cells((i + 1), 3).Value = LabelNumber(i).Caption    ObjExcel2.application.cells((i + 1), 4).Value = LabelOS(i).CaptionNext i' CancelError is True.On Error GoTo ErrHandler' Set filters.CommonDialog5.Filter = "Excel Spreadsheet Files (*.xls)|*.xls"CommonDialog5.FilterIndex = 4CommonDialog5.Flags = cdlOFNOverwritePrompt' Display the Open dialog box.CommonDialog5.ShowSave' Call the open file procedure.Open CommonDialog5.FileName For Output As #5ObjExcel2.SaveAs CommonDialog5.FileNameErrHandler:' User pressed Cancel button.Exit Sub ObjExcel2.CloseObjExcel2.application.quitSet ObjExcel2 = NothingEnd Sub

Export To Excel
I'm having a problem exporting into excel. I've searched around for a few hours but I can't find the asnwer i need.

I can export to excel fine but, I need it to go to next open line. not just keep overwriting. And I also need to be able to specify what spreadsheet to save to. Not just C:/new.xls

Any suggestions?

How To Export To Excel

Can you help me please..

How can i export to excel. I want to use the SQl to select specific columns from my database.

I am using Visual Basic 6 and mysql as my data base.


Export To Excel
Greetings all. I'm trying to get export from VB to Excel working. I've set
up a dummy Excel spreadsheet, and am simply trying to change the value of
two of the cells once I hit my VB pushbutton. VB isn't complaining or crashing, but no updates are happening either. Obviously I haven't pieced together what I need from all available examples to do the job.
Here's what I have:

VB Code:
Private Sub ExportToExcel_Click()    Dim xlApp As Object    Dim blnRunning As Boolean        'Trap errors    On Error Resume Next    ' Set Excel application reference    Set xlApp = GetObject(, "Excel.Application")        If (Err.Number <> 0) Then        Set xlApp = CreateObject("Excel Application")        blnRunning = False    Else        blnRunning = True    End If     xlApp.Workbooks.Open "C:TrialExport.xls"    '  Didn't include actual name of sheet, but it is set in the code    xlApp.Sheets("<sheet name>").Select        xlApp.Range("A3").Select        xlApp.Cells(3, 1).Value = "Exper"    xlApp.Cells(3, 2).Value = "Friday"        xlApp.Save ("C:TrialExport.xls")      If Not (blnRunning) Then        xlApp.Quit    End If  ....    End Sub

I put a watch on xlApp.Workbooks, xlApp.Cells(3,2).Value, xlApp.Range,
xlApp.Sheets. They remain blank as I use the debugger to step though this
code (huh?)

I freely admit to being new to this stuff so please take it easy on me with responses, OK?

What am I missing?


How To Export To Excel
How to export MS Acess data to Excel shett from vb6.0?

Thanx in Advance,,,

Export To Excel
is there statments whereby u can export a whole of a recordset (objRS) including the column names to be put into an excel spreadsheet?

Export To Excel
Is it possible to dump the entire contents of a ListView control to a Microsoft Excel Spreadsheet?

Export Out To Excel
Hi All,

Im trying to write a small proceure from access to call excel and construct a small macro. My question is how do I write a macro to make a macro? For example in my Access applicaiton the user would click an export to excel button. THis button would launch excel and populate it with data. I then want to have a small button that would do some basic sorting. But i havnet been able to figure out how to 1) write code to create the macro 2) assign the macro to the button. I want to do this without creating an excel addin.



Msg Box On Top Of Excel Export
I'm using V.B. in Microsoft Access to export data into an Excel Spreadsheet. I then use a msg box to say that everything is done but it shows up under the Excel file. Is there a way to get the msg box to show up on top of everything?

Export To Excel
Hi All,

I have a little problem with my App, I have been doing some exporting from
a MSHFLEXGRID to a normal (*csv)comma text delimited file this way:

Open FileName For Output As #1
Write #1, , , , , App_Name
Write #1, , , , tDate, Ttime
Print #1,
Print #1,

With frmMain.Grid
For indxa = 0 To .Rows - 1
OutStr = ""
For indxb = 0 To UBound(x)
OutStr = OutStr & .TextMatrix(indxa, Val(x(indxb))) & ","
Next indxb

OutStr = Left(OutStr, Len(OutStr) - 1) 'remove the last comma
Print #1, OutStr
Next indxa
End With
Close #1

Now this works fine.... but I can't do any filtering with Microsoft
Excel.... so I would like to know how can I do the same thing but instead of
exporting to a comma delimited file to a (*.xls) file.... So that all the
Excel Functions can be used when the Document is Opened...
Note: i have seen some solutions where a worksheet is opened and the records
are visible while they add to the sheet. I can't have this since my records
will be around the 20,000 to 50,000 records and up to 20 columns so this
will take an awfull lot of cpu procesing to complete.

Please if possible my task let me know with some code or point me to the
right direction...
God Bless You!!!

God Bless You

Export To Excel
I'm working with vb6.
i want to export the data that i have in my list box to excel.
i want also to be able to make the "Save as".

how can i do it?
thanks for the help

Export: Excel
So I have this application that accesses an MS-SQL 2K server via ADO. The application is written in VB.

The application uses a ListView control to display ADO recordset content. Now I added a button that exports the content of the ListView to Excel.

The method for the export from the VB app to Excel is via Arrays. It works fine.

My question is, isn't there a faster way?  Right now, the export takes each column in the ListView and creates an Array. The Array is then looped thru to place in an Excel Spreadsheet (that is neither visible during the export, nor saved after it is made visible to the user).

Like I said, it works good until you hit a recordset with many records and many columns being returned.

Any suggestions?


Export To Excel
Is there a way in VB to export a recordset directly to Excel with out going through the rows and columns? Just a straight dump to an Excel template. I know you can do it in Access VB but haven't been able to accomplish it in VB.



Export To Excel
Is there a way in VB to export a recordset directly to Excel with out going through the rows and columns? Just s straight dump to a template and let Excel macros handle the rest. I know you can do it in Access VB but havne't been able to accomplish it in VB.



Export To Excel
How can i export data from Msflexgrid to Excel spread sheet?!
Thanks alot for advice

Egyptian Man

Edited by - khaledagwa on 9/8/2004 11:38:55 AM

Copyright © 2005-08, All rights reserved