Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Disable the Preview when report is modified
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00591464
Message ID:
00592564
Vues:
22
Hi!

1) Function is nto to call report. Function is called from report as soon as report runs (for preview). So when you have no data prepared, report starts on the cursor with a single empty data row, preparing which would not be a problem. That function, before VFP engine starts to render report layout, will query reall data to prepare before something really displayed for preview. This way you will not prepare data BEFORE report editing. You will prepare data only ON-DEMAND - as soon as user star to preview the report.

2) Yes. Just CREATE cursor command that is easy to generate because most fields already defined.

3) You probably can display parameters form before running the query in the described function. Well, if it is a page in the pageframe on the main form - you probably right, parameters will require a separate form.

Of course, you can in mentioned above function instead of the query runnign display just a message that a record source is not available and abandon the report preview by sending KEYBOARD "{CTRL+F4}" command. This will flash the report preview window anyway. I just tested this approach and it works (quite simple).

>Hi Vlad,
>
>I am not that clear in here.
>
>1) Add a function to call the report among other things! I have such a method to do that.
>
>2)Ok so before the edit report I will create a cursor with one record even though the user knows that this type of calling should be be a preview
>
>3)
>I am not clear for the rest, in some situations I have a parameters form and the user may not like it, that's way I created an option to preview with no data source.<s>
>
>I realy would like to trap that preview based on that one record and display a message.
>
>Regards,
>
>Doron
>
>
>>
>>I seems know the solution, but I do nto know if it will work - need some time to try it and see if it will work at all.
>>
>>Add a function call to the report somewhere that is called the first of all other things. Then prepare a temporary cursor with only one empty record for that report before report editing. When that function is called, it indicate that report is ran. From this function just run a query for that report to prepare the data. SO, when user request to preview the report, the query ran to get its data. When no requesting to preview, the data are not prepared for report at all. After query running just copy these data into the temporary cursor. Still NO running of the report, though I guess this could be used for printing too.
>>
>>Really, I never knew if above works (dynamical preparing data for report "one the fly"). Though I think it worth to try if such feature is really needed (no data for report preview when user designing report in run-time). Just prepare these data when user requests to preview and thats all ;))
>>
>>Well, still no good solution to cancel such thing properly - when user cancel query runnign (for example, using progress bar or just "ESCAPE" key), data will not be prepared and as a result preview will show one empty record or even no preview (blank window flashes).
>>
>>HTH.
>>
>>
>>>Hi There,
>>>
>>>They talk around the subject but there is no any solution for the problem.
>>>
>>>Thanks,
>>>
>>>Doron
>>>
>>>>>
>>>>>When modify the report is there a way to disable the Preview option when
>>>>>right click on top of that report. There could be a situation that
>>>>>the report has no data source and I am trying to prevent running that report in this situation.
>>>>>
>>>>
>>>>Hi Doron,
>>>>
>>>>Take a look at Thread #552030 that discussed this topic.
Vlad Grynchyshyn, Project Manager, MCP
vgryn@yahoo.com
ICQ #10709245
The professional level of programmer could be determined by level of stupidity of his/her bugs

It is not appropriate to say that question is "foolish". There could be only foolish answers. Everybody passed period of time when knows nothing about something.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform