rPreveiw : EMAIL & Excel issues

rPreveiw : EMAIL & Excel issues

Postby TimStone » Mon Sep 23, 2013 9:42 pm

I've been using a modified, older, rPreview but now could use the new one. However, I have two questions:

1) Email: To send email, rPreview creates an object which then calls the default email program. This is fine if my client has Outlook installed. However, many use online email services, so I have them setup with SMTP services. Can I do a setup for the rPreview email that specifies what email to use ? ( ie. how would they use it with GMail ? )

2) Excel: You can perform an initialization in tReport so an output can be sent to Excel. However, all of my reports are written with the Printer class directly. All of the work and logic is performed in the .PRG with output sent directly to the printer. When I activate the Preview for a report, it lays out perfectly, works with the Word interface, and works with the PDF interface. a) How could I specify bInit within that methodology, and b) What value would I use to start the report where I'm already set in my code ( rather than issuing a gotop( ) ?

Thanks. I know these have been around for awhile, but "if it aint broke, don't fix it" means my own code was working OK ... but this newer version of rPreview would be better. ( Also, I was using an external PDF converter ).
Tim Stone
http://www.MasterLinkSoftware.com
http://www.autoshopwriter.com
timstone@masterlinksoftware.com
Using: FWH 23.10 with Harbour 3.2.0 / Microsoft Visual Studio Community 2022-24 32/64 bit
User avatar
TimStone
 
Posts: 2904
Joined: Fri Oct 07, 2005 1:45 pm
Location: Trabuco Canyon, CA USA

Re: rPreveiw : EMAIL & Excel issues

Postby TimStone » Tue Sep 24, 2013 5:37 pm

Antonio,

I pushed this up in case you missed it

Tim
Tim Stone
http://www.MasterLinkSoftware.com
http://www.autoshopwriter.com
timstone@masterlinksoftware.com
Using: FWH 23.10 with Harbour 3.2.0 / Microsoft Visual Studio Community 2022-24 32/64 bit
User avatar
TimStone
 
Posts: 2904
Joined: Fri Oct 07, 2005 1:45 pm
Location: Trabuco Canyon, CA USA

Re: rPreveiw : EMAIL & Excel issues

Postby Antonio Linares » Tue Sep 24, 2013 8:52 pm

Tim,

1. We are actually using MAPI to send the email:

Code: Select all  Expand view
  DEFINE MAIL oMail ;
      SUBJECT "Testing..." ;
      TEXT "Test" ;
      FROM USER ;
      RECEIPT

   ACTIVATE MAIL oMail


I am afraid that can not be connected with gmail, web outlook, yahoo, etc. There have been several posts about gmail here in the forums. If we find a good working one then we could include it in the preview.
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 41315
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: rPreveiw : EMAIL & Excel issues

Postby Antonio Linares » Tue Sep 24, 2013 8:56 pm

Tim,

In the meantime this may help:
http://superuser.com/questions/573568/gmail-as-default-windows-mail-program-not-same-as-mailto

Specially this which seems very interesting:
The open-source project Tvhgooglemapi might be a solution. Here is how it is described :

Tvhgooglemapi is a simple tool that pretends to be a real mail client to windows but really only uploads the mail to the drafts folder of gmail and then opens the draft in the default web-browser. For the user this is almost exactly the same as having the gmail web interface as the default mail-client for some windows applications (the only difference being that he has to login twice if he is not already logged in to gmail and doesn't let the tool remember the password.)
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 41315
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: rPreveiw : EMAIL & Excel issues

Postby Antonio Linares » Tue Sep 24, 2013 9:00 pm

Tim,

2. In your PRINT ... ENDPRINT code sections, simply add the PREVIEW clause:

Code: Select all  Expand view
PRINT oPrn PREVIEW

ENDPRINT


So the preview will appear with all its features :-)
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 41315
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: rPreveiw : EMAIL & Excel issues

Postby TimStone » Tue Sep 24, 2013 9:05 pm

Antonio,

I've had email and PDF for a number of years in a revised version of tPreview. It has worked well, and I may modify the current rPreview to do the email using it.

I solved all of my problems by having SMTP or CDO available in the system email setup. Then I simply pass the email to my system which sees how it is configured and sends it that way. I could offer the MAPI interface also.

The other issue we should address is a way to feed a TO address when we create the report. In some cases we would need to fill it in. However, if I'm looking at a document specific to a client ( ie an Invoice or Sales Report ), it would be nice for my customer to have that data filled in when the email comes up.

I still have the question about Excel. Please look at my original post for the details. I have the PREVIEW selection ... that is not the problem. I want to have the ability to export to EXCEL and that requires the bInit codeblock. How would I pass that from the PRINT object ?

Thanks. Your support is always greatly appreciated.

Tim
Tim Stone
http://www.MasterLinkSoftware.com
http://www.autoshopwriter.com
timstone@masterlinksoftware.com
Using: FWH 23.10 with Harbour 3.2.0 / Microsoft Visual Studio Community 2022-24 32/64 bit
User avatar
TimStone
 
Posts: 2904
Joined: Fri Oct 07, 2005 1:45 pm
Location: Trabuco Canyon, CA USA

Re: rPreveiw : EMAIL & Excel issues

Postby Antonio Linares » Tue Sep 24, 2013 10:04 pm

Tim,

The Method ToExcel() is only available for a TReport object as it uses its columns to export it to Excel.

If you could adapt your printer work as a report, then you could export it to Excel, as it would have the required columns.
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 41315
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: rPreveiw : EMAIL & Excel issues

Postby TimStone » Tue Sep 24, 2013 10:14 pm

Many of my reports involve categorical sums and thus are not easily handled by tReport. There is also a lot of descriptive formatting. Its not just column stuff.

I actually have many of them with an option to export to Excel. However, its done prior to passing it to rPreview.

I'll work with rPreview and modify it to meet my needs. I'll send you the changes and if you like them you can add them into the distribution.

One change you might make is to grey out the Send To Excel button when it is not a useable option.

Tim
Tim Stone
http://www.MasterLinkSoftware.com
http://www.autoshopwriter.com
timstone@masterlinksoftware.com
Using: FWH 23.10 with Harbour 3.2.0 / Microsoft Visual Studio Community 2022-24 32/64 bit
User avatar
TimStone
 
Posts: 2904
Joined: Fri Oct 07, 2005 1:45 pm
Location: Trabuco Canyon, CA USA

Re: rPreveiw : EMAIL & Excel issues

Postby Antonio Linares » Tue Sep 24, 2013 10:49 pm

Tim,

>
I'll work with rPreview and modify it to meet my needs. I'll send you the changes and if you like them you can add them into the distribution.
>

thanks :-)

> One change you might make is to grey out the Send To Excel button when it is not a useable option

Good idea, already implemented and also for the Word button, thanks :-)
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 41315
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 82 guests