New to VBScript -> Convert .rpt to .xls

Author Message
tazz_da_inferno

  • Total Posts : 2
  • Scores: 0
  • Reward points : 0
  • Joined: 2/7/2012
  • Status: offline
New to VBScript -> Convert .rpt to .xls Tuesday, February 07, 2012 3:52 AM (permalink)
0
Hi,
 
I am new to VB Scripting. I want to convert a .rpt file (Crystal Report file) or even a .pdf file to an Excel file (.xls, must be 97-2003 version). The formatting should be same, i.e. excel to have exact format as the .rpt file.
 
I basically want to pass the .rpt file path and name as an input /argument and output the .xls file, by calling the vb script. I will be invoking this .vbs file (VB script) from another application. Any kind souls out there to help me with my case.
 
PS: If input can't be given as .rpt, it would still be fine with me to pass .pdf as an input argument.
 
#1
    59cobalt

    • Total Posts : 977
    • Scores: 91
    • Reward points : 0
    • Joined: 7/17/2011
    • Status: offline
    Re:New to VBScript -> Convert .rpt to .xls Tuesday, February 07, 2012 10:27 AM (permalink)
    0
    This might be a starting point.
     
    #2
      tazz_da_inferno

      • Total Posts : 2
      • Scores: 0
      • Reward points : 0
      • Joined: 2/7/2012
      • Status: offline
      Re:New to VBScript -> Convert .rpt to .xls Wednesday, February 08, 2012 3:28 AM (permalink)
      0
      Hi
       
      So far I managed to write a .vbs that opens the crystal report. I am using Crystal Reports Viewer 2008.
       
      'Code Starts
      Option Explicit
      Dim oRpt, oApp, x
      Set oApp = Wscript.CreateObject("Wscript.Shell")
      oRpt = "C:\Program Files\Crystal Reports Viewer 2008"
      x=Chr(34) & "C:\Documents and Settings\tazz\Desktop\strat.rpt" & Chr(34)
      oApp.Run Chr(34) & oRpt & "\CrystalReportsViewer.exe" & Chr(34) & x, 0, "FALSE"
      'Code Ends
       
      The above .vbs, when run from cmd prompt, manages to open the .rpt file using crystal reports viewer 2008. After opening .rpt file, I am manually exporting to Excel. I want to implement the exporting to excel part, in my above .vbs code. I know there are some .exportexcel options or something of this sort. I am not sure how to do that, any help/ code would be great for me.
       
      My objective : I have .rpt file as an input. I simply want to convert it to a .xls file with retaining format of crystal report. (Just like manually opening a crystal report, exporting to excel 97-2003 and selecting 'OK' when the excel format dialog box pops up)
       
      Waiting for some kind souls out there to help!
       
       
       
      #3

        Online Bookmarks Sharing: Share/Bookmark

        Jump to:

        Current active users

        There are 0 members and 1 guests.

        Icon Legend and Permission

        • New Messages
        • No New Messages
        • Hot Topic w/ New Messages
        • Hot Topic w/o New Messages
        • Locked w/ New Messages
        • Locked w/o New Messages
        • Read Message
        • Post New Thread
        • Reply to message
        • Post New Poll
        • Submit Vote
        • Post reward post
        • Delete my own posts
        • Delete my own threads
        • Rate post

        2000-2012 ASPPlayground.NET Forum Version 3.9