QDataGridExporterButton plugin (former QDataGridExporter) proposed to QCubed fan

Login or register to post comments
13 replies [Last post]
grossini's picture
Offline
Joined: 01/05/2009

Glad to share my first experimental plugin, able to create a button in List or Panel to download DataGrid content.

My best thanks to Alex for precious advice to this old RPG programmer (RPG is a very old program language used in IBM starting from
System/3 and evolved to RPGIV on As400 now Iseries).

I updated also SVN to reflect this new entry, but I am confused on step to have this plugin in
plugin directory (if the plugin can gain the publication's honour).

CVS in a very poor structure whit embedded oddity ( comma!!! to sepearate fields) so I added an XLS structure. The XLS proposed is a simplified version that works in my office 2000 - derived from format used to export in Excel by PHP Report Maker v.3 with my simple modification to display grid lines on excel Worksheet ( without grid the worksheets look unpleasant !! - why not HKVSTORE).

Note on excel oddness.
Excel is confused by cell with code number >16 (e.g. IBAN ).
Last digit (at right) are lost due to conversion in float. Added in plugin function to prefix it by 'c:'

Gianni.

alex94040's picture
Offline
Joined: 11/06/2008

Gianni, I'm thrilled to see you making great progress with QCubed! There's still a few earlier comments of mine that you might want to implement (http://qcu.be/content/qdatagridexporter-plugin-prerelease#comment-3817).

Also, please fix tabs / spaces in the SVN - it would really help others that are trying to understand your code.

Thanks again for doing this!
-Alex

enzo's picture
Offline
Joined: 03/31/2008

Hello Grossini

Great job, I just fix a little error with constructor and strControlId and change the file structure to improve the plugin structure all changes are in http://trac.qcu.be/projects/qcubed/changeset/809/plugins/QDataGridExport...

Regards,

enzo

alex94040's picture
Offline
Joined: 11/06/2008

Thanks so much for doing this, enzo! Do you care to make one more fix - clean up the code to remove the spaghetti code switch statement from buttonCVS_clicked(), and split out the code into separate functions based on the export type?

Thanks!!
-Alex

enzo's picture
Offline
Joined: 03/31/2008

Hello Alex

Nope I didn't have enough time, I just fix and update the plugin structure.

Regards,

enzo

alex94040's picture
Offline
Joined: 11/06/2008

Do you think you may have a little time to do it in the near future?

grossini's picture
Offline
Joined: 01/05/2009

very excited to see community in action.
Thank's for your presence.... Gianni

alex94040's picture
Offline
Joined: 11/06/2008

I have just checked in an update to the plugin: version 0.5. It's checked in to the /plugins folder.

Demo: http://examples.qcu.be/assets/plugins/QDataGridExporterButton/example/da...

Download the latest version 0.5: http://trac.qcu.be/projects/qcubed/export/812/plugins/QDataGridExporterB...

enzo's picture
Offline
Joined: 03/31/2008

Hello Alex

Well I will try to that ASAP, I was a little far of qcubed, because I was working in Drupal project, you know is hard to find freelances based in Qcubed.

cu

enzi

alex94040's picture
Offline
Joined: 11/06/2008

I've actually implemented all the modifications I mentioned earlier myself - they are in v0.5 of the plugin. So we're good :)

grossini's picture
Offline
Joined: 01/05/2009

hello Alex, thanks to your cleaning activity on my experimental plugin.
Now it looks professional as I will never be able to do.

I saw the result and I am proud of where I went with your guidance on my first steps on Object Oriented world.

I am thinking on adding PDF export .... in next future.

Ciao e grazie ancora. Gianni

Offline
Joined: 06/15/2010

i actually used your QDataGridExportButton and after adding it to my project and also adding it to my page, it runs perfect but when i click to download the DataGrid in any of the format, I get the below error msg:

============================================================
Control cannot be rendered until RenderBegin() has been called on the form.
Exception Type: QCallerException

Rendered Page: Click here to view contents able to be rendered

Source File: C:\wamp\www\dom\includes\qcubed\_core\base_controls\QControlBase.class.php Line: 1065

Line 1060: * @param boolean $blnDisplayOutput render the control or return as string
Line 1061: * @return string
Line 1062: */
Line 1063: public function Render($blnDisplayOutput = true) {
Line 1064: // Call RenderHelper
Line 1065: $this->RenderHelper(func_get_args(), __FUNCTION__);
Line 1066:
Line 1067: try {
Line 1068: $strOutput = $this->GetControlHtml();
Line 1069: } catch (QCallerException $objExc) {
Line 1070: $objExc->IncrementOffset();

============================================================

and my controls were rendered after the RenderBegin() was called.

Pls can you help me?

Thanks in Anticipation

alex94040's picture
Offline
Joined: 11/06/2008

Some questions for you:
1) What version of QCubed are you running? Which version of the plugin are you running?
2) Does the example file similar to this one working on your local installation: http://examples.qcu.be/assets/plugins/QDataGridExporterButton/example/da...
3) Can you share your .tpl file and your form?

grossini's picture
Offline
Joined: 01/05/2009

In my development of qdatgridexporterbutton I remember some similar to your problem.

My solution, if I remember, was add exit(); at the end of public function btnExport_clicked in QDataGridExporterButton.class.php.

Additionally in my memory I found something related to HTML header info ....

Download last version ...QDataGridExporterButton_0.5_1.1_2010-03-02.zip.

I installed in qcubed version 2.0.1 now and checkhed it: examples work as expected.
--------------------------------------------------------------------------------------
Buon Natale (Merry Christmas ) to all qcubed fan, Gianni