Jump to content
Sign in to follow this  
enigma1

osC mySQL

Recommended Posts

select concat(products_name, ' - ', products_description, ' - - - ', products_viewed) as everything from products_description where language_id = 1

 

i understand this , but for sql , not pdf report , i still would like to know if i can have the different language for the same name product

 

like if i wrote this :

 

select concat(products_name, ' - ', products_description, ' - - - ', products_viewed) as everything from products_description where language_id = 1 AND NEXT LINE where language_id = 4 AND NEXT LINE where language_id = 1

 

the question is not on the fields i can add bu more on how to have the same info for each language in hte shop , see my previous exemple


MS2

Share this post


Link to post
Share on other sites

the thing is each row will return a set of separate columns. Those columns will repeat themselves. You may have to customize the script for that.

Share this post


Link to post
Share on other sites
and see if you get this error printed.

 

I still get the same error

 

I see now that for some queries it works

 

This one works

select * from products p left join products_description pd on p.products_id=pd.products_id where pd.language_id = 5

 

This one not

select p.products_image, pd.products_name from products p left join products_description pd on p.products_id=pd.products_id where pd.language_id = 5

 

Regards,

Alex

Share this post


Link to post
Share on other sites
I still get the same error

 

I see now that for some queries it works

 

This one works

select * from products p left join products_description pd on p.products_id=pd.products_id where pd.language_id = 5

 

This one not

select p.products_image, pd.products_name from products p left join products_description pd on p.products_id=pd.products_id where pd.language_id = 5

 

Regards,

Alex

 

I just tried it but I do not see the problem. In my case I have no language=5 so it creates a pdf report with the title.

 

What happens when you execute other queries for instance:

 

select customers_firstname from customers

 

or

 

select pd.products_name from products_description pd where pd.language_id = 5

Share this post


Link to post
Share on other sites
I just tried it but I do not see the problem. In my case I have no language=5 so it creates a pdf report with the title.

 

What happens when you execute other queries for instance:

 

select customers_firstname from customers

 

or

 

select pd.products_name from products_description pd where pd.language_id = 5

 

Both queries give the same error.

 

I did some testing and when i use the first query I can see that the value of sizeof($colFits) = 1 and $this->numFields = 1

1 - 1 = 0 so we get the Devision by zero error.

Share this post


Link to post
Share on other sites
Both queries give the same error.

 

I did some testing and when i use the first query I can see that the value of sizeof($colFits) = 1 and $this->numFields = 1

1 - 1 = 0 so we get the Devision by zero error.

 

yes you're right, thanks for the report, here is a workaround, I added some extra checking so you should be ok. Here it is:

 

Replace both functions (mysql_report, query_report in pdf_mysql_report.php class file) this line of code

 

$distribution = $surplus/(($this->numFields)-sizeof($colFits));

 

		if( (($this->numFields)-sizeof($colFits)) <= 0 )
	  $distribution = 0;
	else
	  $distribution = $surplus/(($this->numFields)-sizeof($colFits));

 

I will include this fix with the next release.

Share this post


Link to post
Share on other sites

Mark,

I'm about to add this excellent tool to my backend but wanted to check to see if you were going to release an update any time soon.

Any news, tweaks etc?


-Dan

Always, always back up your files before you make any changes!

Share this post


Link to post
Share on other sites
Mark,

I'm about to add this excellent tool to my backend but wanted to check to see if you were going to release an update any time soon.

Any news, tweaks etc?

There're few items I am working on but it maybe sometime before making the next release.

Upgrades with new versions will be mostly backwards compatible unless you have your own customizations.

Share this post


Link to post
Share on other sites

OK, are there any issues with the current release other than FF compatability?


-Dan

Always, always back up your files before you make any changes!

Share this post


Link to post
Share on other sites
OK, are there any issues with the current release other than FF compatability?

Should be no ff compatibility issue with v1.01 as I remember it should include the extra browser check.

Share this post


Link to post
Share on other sites

I've finally gotten around to installing this and have the same set of errors mentioned on page 1 of this thread. The fixes suggested have stopped the first error but I still get the :

Warning: Cannot modify header information - headers already sent by (output started at /homepages/0/d112133822/htdocs/sub1/catalog/amin/includes/application_top.php:11) in /homepages/0/d112133822/htdocs/sub1/catalog/amin/pdf/fpdf/fpdf.php on line 1071
FPDF error: Some data has already been output to browser, can't send PDF file

 

When I try even a simple little column and click the pdf button on the right.

 

Also, is the top area supposed to load the script from the dropdown menu of my saved scripts? I don't think I have anything disabled in my browser that would stop it from functioning.


-Dan

Always, always back up your files before you make any changes!

Share this post


Link to post
Share on other sites

Ok so there is a bunch of warnings I see when I set full error report from the pdf class. I will have to make another release to fix these problems. For the time being just below the mysql_report and query_report functions in pdf_mysql_report.php add this

 

	  $colFits = array();
  $totAlreadyFitted = 0;

It will initialize these 2 variables. There are others though, which I fixed and tested here but the version I use is quite different. It will take me some time to test it and do the release.

 

The problem happens because if you get a warning from the php it will be sent to the output so the no pdf will be generated.

 

And when you select an entry from the repository drop-down it should place the script in the text area. At least I tried it here with IE and FF and it works. Just make sure your jscript is functioning.

Share this post


Link to post
Share on other sites

Mark,

I still think this has the most tremendous potential of just about any Contrib. I run queries manually on a regular basis and this would make it much easier. Please continue to work on it as you get the time!

Request: I could use a csv file export option.

Trouble: I get an error of headers already sent like this:

Warning: Cannot modify header information - headers already sent by (output started at /home/brushwoo/public_html/catalog/amin/includes/application_top.php:11) in /home/brushwoo/public_html/catalog/amin/pdf/fpdf/fpdf.php on line 1071

FPDF error: Some data has already been output to browser, can't send PDF file

Then again, I just moved hosts and have a few issues on this. I get it also when I use the search function looking up a customer (in customers.php). I'll probably ask about it in general support but thought I'd mention it here in case it's code specific.


-Dan

Always, always back up your files before you make any changes!

Share this post


Link to post
Share on other sites

Dan, I think something else is going on. Because this module includes the fpdf library only within the pdf_mysql_report.php. So it cannot come from the application_top.php and especially with other scripts like the customers.php. Do you have another contribution/module in your admin that uses the fpdf library?

 

And I have already the csv exporting working (for sometime now) but no time to release it properly. I am still looking at some issues with the pdf class and the way the cells are generated. I need to update/fix the class there and in the meantime I am trying to setup an xml export as well which I may push back. I cannot give you my word but I'll try to update it.

Edited by enigma1

Share this post


Link to post
Share on other sites

When I want to report the 'products' in pdf I get this error:

 

Warning: Invalid argument supplied for foreach() in /virtualusers/xxxxx/xxxxx/xxxxxxxxxx/public_html/admin/includes/classes/pdf_mysql_report.php on line 255

 

Line 255 gives me: foreach($colFits as $key=>$val){

 

Other reports do work but the 'products' won't...

 

Anybody know the solution?

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×