Text does not support formatting. You’ll get the data from the report, but the positioning will be limited, at best.
Read them again. When you see a call to ConvertTo, it is being applied to the cube (data provider). When you see a call to ExportAsText or ExportAsPDF that is being applied to the report (or document, if available).
I understand; it can be confusing. The menu item to save the data provider (cube) is Export, while the menu item to save a report as text is Save As. But the VBA equivalents are:
Export => ConvertTo()
Save As => ExportAs{Type}
… where {Type} can be Text, RTF, PDF, or HTML.
seems very interesting add-in. unfortunately, when i tried to reach out Avaski’s donwload page, its stopped me saying unauthorized entry kind of IE message.
But i am desparately looking forward a kind of code. hope it wold contains creating New worksheet in already existing excel file.
When I used it it asked me whether I wanted to export the entire document and when I said ‘yes’ it put each report in a separate tab of the same spreadsheet. That sounds like maybe it would be helpful to you. Try the link in this thread.
Is there a out of box solution for converting Business Objects reports to text files retaing exact formatting of all the tables.? Save as txt distorts the formatting. I am looking at some solution which will convert it to proper text file. Any solution which uses any external software also is fine.
Text files don’t have formatting. If you need formatting, you can try RTF instead. Or - as someone else in this topic mentioned - save as HTML and then process via some other application.
But text files are just that, letters and numbers. Spacing / formatting / layout is all lost.
But there has to be some way by which I can format these unformatted files to the required format. Excel has row limitaions. Other products like Brio and Crystal reports retain the format. Any scripting language like awk can be used or not.
I have one question about this code, export the report (raw data) as a CSV file by using the convertto() function.
There is one column, which has commas in it. When I opened the report in Notepad, this column was separated as multiple columns due to the comma inside the column. Users want this column will be inside a double quote. I created a variable in the report, using char(34), but it didn’t work. I wonder if I have to define the variable in the universe, then it will work. I haven’t tried that yet.
Remove the headings from the report or have a second tab just for exporting without headings. Or did I misunderstand your question?
Never mind, you want to remove the headings when you export from the d/p not the report.
Alternatively, I know that I can’t export the report per se as .csv but could I use some creative technique to concat a ‘,’ with the data…
I still can’t get rid of those pesky tab delimiters though . I may be asking the impossible. At this point I’m making a report with Essbase, Oracle and various and sundry other data providers so if I have to give them tabs, that may be what they have to accept. I’m already working a miracle here
Hi Dave
The above macro works fine in version 5 FC.
But in Version 6 FC it gives the following error: " Compile error :Type Mismatch " at the last line boDP.ConvertTo.
Any ideas why its not working in Version 6 FC.
I tried without assigning it to intReturntCode . Still it didn’t work.
Thanks for your time
Veera
Hi
I fixed it.
The code looks like below in version 6.
Dim bodoc As busobj.Document
Dim boDP As busobj.DataProvider
Dim strOutputFileName As String
Dim intReturnCode As String
Set bodoc = ActiveDocument
Set boDP = bodoc.DataProviders.Item(1)
strOutputFileName = "C:\CSVOutput.csv"
We just copied the whole repository of v5 to v6.5. When I tested reports, those with macros give me some error message. I have one report using this piece of code, which worked perfectly in v5.1.5, but it keeps saying “Type Mismatch” for the last line: boDP.ConverTo.
I don’t have an explanation for why it works in v5, other than it was a sloppy implementation in v5 that was fixed in v6. The ConvertTo method is not documented as a function, which would be necessary to bring back a return code. Just replace “intReturnCode =” with “Call” in that one line, and you should be good to go.
Great! If you think this thread was helpful, consider giving it a “point” … the thumbs-up icon at the lower right of each post. Someday, we’ll use the “points” information in BOB’s search functionality.