CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 11 of 11
  1. #1
    Join Date
    Aug 2011
    Posts
    4

    include an excel file into an app

    I,I'm from Italy

    i've a com fully working compiled VB6 (SP6) program.
    Now i want to know if it's possibile to include an excel file into the app,without leaving it alone.
    let me explain.
    that file is used as an invoice and is rich of borders,textbox,lines so i can't open a new one.
    i don't want somebody tries to modify it,i prefer to let my colleagues only to press "print" and add the information i need from the app and include it into the app.
    do you think it's possible?
    i can switch it into a word or pdf file it'd be better.
    thank for your attention

    Fabio

  2. #2
    Join Date
    Jan 2006
    Location
    Fox Lake, IL
    Posts
    15,007

    Re: include an excel file into an app

    I'd have the user create a TEXT FILE, and then have a LOAD and then PRINT button... It'd be easier to code, but you'd have to re-write at least one part
    David

    CodeGuru Article: Bound Controls are Evil-VB6
    2013 Samples: MS CODE Samples

    CodeGuru Reviewer
    2006 Dell CSP
    2006, 2007 & 2008 MVP Visual Basic
    If your question has been answered satisfactorily, and it has been helpful, then, please, Rate this Post!

  3. #3
    Join Date
    Jul 2008
    Location
    WV
    Posts
    5,362

    Re: include an excel file into an app

    I would think you could include it as a resource though I have never tried. I wonder though why use an excel file at all? For creating an invoice I would use a report that is contained within my exe and print it out. No external file to have to worry about, no need for the user to install Excel on the system and no need to use all those extra resources up when they are not needed for the task at hand.

    Personaly I avoid using Excel in any programs I write and deter customers from it as much as possible related to data storage and reporting. I do however add an option into my programs that will create an excel file from any report.
    Always use [code][/code] tags when posting code.

  4. #4
    Join Date
    Jan 2006
    Location
    Fox Lake, IL
    Posts
    15,007

    Re: include an excel file into an app

    I used a RTB, loaded a DOC file, and did 39 FIND/REPLACE's, added BOLD and different FONTS, then added an IMAGE (into the old spot with COPY/REPLACE)

    Then, showed it on the screen preview, before sending it to the printer. Back in 2006...
    David

    CodeGuru Article: Bound Controls are Evil-VB6
    2013 Samples: MS CODE Samples

    CodeGuru Reviewer
    2006 Dell CSP
    2006, 2007 & 2008 MVP Visual Basic
    If your question has been answered satisfactorily, and it has been helpful, then, please, Rate this Post!

  5. #5
    Join Date
    Jul 2008
    Location
    WV
    Posts
    5,362

    Re: include an excel file into an app

    Interesting, I've been using Active Reports since 98 and would hate to use anything else. The fact that the reports become part of your exe and you use real VB code within the report. Basically it becomes like a form in your project with some new properties for datasource, headers, footers details and grouping levels. Reports are a snap and can be exported to Excel or PDF with one line of code.

    Hard to imagion having to use anything else at this point.
    Always use [code][/code] tags when posting code.

  6. #6
    Join Date
    Aug 2011
    Posts
    4

    Re: include an excel file into an app

    DataMiser it sound interesting...by the way do you use crystal report or another.
    the invoice made in excel at the moment is rich of boxes,border of different types,colours and so on.
    i can't create an excel file as new,but i don't know if i can create a report due i don't have a database.
    perhaps those are stupid question from your point of view but i'm reading all around to find a solution..

  7. #7
    Join Date
    Jan 2006
    Location
    Fox Lake, IL
    Posts
    15,007

    Re: include an excel file into an app

    Here's the AFTER EDIT screen: Hmm, can't upload .RTF file format. Have a DOCX
    Attached Files Attached Files
    Last edited by dglienna; August 16th, 2011 at 09:55 AM.
    David

    CodeGuru Article: Bound Controls are Evil-VB6
    2013 Samples: MS CODE Samples

    CodeGuru Reviewer
    2006 Dell CSP
    2006, 2007 & 2008 MVP Visual Basic
    If your question has been answered satisfactorily, and it has been helpful, then, please, Rate this Post!

  8. #8
    Join Date
    Aug 2011
    Posts
    4

    Re: include an excel file into an app

    this is what i should create at the moment...
    Attached Images Attached Images

  9. #9
    Join Date
    Jul 2008
    Location
    WV
    Posts
    5,362

    Re: include an excel file into an app

    Quote Originally Posted by eurostar_italia View Post
    DataMiser it sound interesting...by the way do you use crystal report or another.
    the invoice made in excel at the moment is rich of boxes,border of different types,colours and so on.
    i can't create an excel file as new,but i don't know if i can create a report due i don't have a database.
    perhaps those are stupid question from your point of view but i'm reading all around to find a solution..
    I use Active Reports [ I hate to use Crystal Reports ] Naturally you can use a database with active reports but it is not limited to this. You can assign anything on the report through code at runtime. You can write code just like it were a form in your project. Report.Label1.Caption="MyLabel" for example.

    It supports DAO, RDO and ADO in the version I use. Basically if you can create an odbc datasource you can bind it to the report engine in design mode and of course can change the source at anytime during runtime as well as being able to just populate the fields through striaght VB code.

    The new version supports the latest .net environments as well and the pro version allows you to include a WISISWYG report editor in your program for distribution. Both pro and standard also give a report viewer control that is web enabled so you can display the same reports online as well as export filters for Excel, PDF and others.

    Unfortunately this report tool is only for the serious as it carries a hefty price tag but IMO it is worth every penny and more.
    Always use [code][/code] tags when posting code.

  10. #10
    Join Date
    Aug 2011
    Posts
    4

    Re: include an excel file into an app

    i posted a pdf of what we use at the moment.
    basically i should use crystal report for what i'm doing (i'm creating this app ,to semplify my job, i can't buy a program) i didn't know i can create a report without a db.
    i only import an excel file with some information (name,id,pnr code,etc.) and print it by adding a variant to a form..

  11. #11
    Join Date
    Jul 2008
    Location
    WV
    Posts
    5,362

    Re: include an excel file into an app

    VB 6 has it's own build in report tool that is not bad, I've never really used it other than to clean up code that others have written but from what I saw of it looks like it would do the job.
    Always use [code][/code] tags when posting code.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured