1. Jan Steinman
  2. Report Editor
  3. Montag, Mai 16 2016, 05:32 AM
  4.  Abonnieren via E-Mail
I want to do something like the ability to change the style of even/odd rows, but only by columns; I want to have records with a certain field that is even show up on the left, and records with that field odd to show up on the right.

I tried the old pivot technique of putting "IF(Rib % 2 = 0, Rib, NULL) AS LRib" and "IF(Rib % 2 = 1, Rib, NULL) AS RRib", but it ends up doing two rows with one column blank in each. I then did GROUP BY Rib, but that didn't change anything.

Any helpful clues about good ways to this?

Thanks!
Kommentar
There are no comments made yet.
Ivan Smahin Akzeptierte Antwort
It is all about MySQL or Valentina db? Could you provide complete sql query?
Kommentar
There are no comments made yet.
Sergey Pashkov Akzeptierte Antwort
Hi Jan,

I can see that the only option is to define a conditional style for even/odd rows.
But it doesn't allow to hide controls, however it is possible to set the colour of text to match the region background.
Kommentar
There are no comments made yet.
Sergey Pashkov Akzeptierte Antwort
Not the cleanest solution.
Is this feature required in multiple reports/projects or only once?
Kommentar
There are no comments made yet.
Jan Steinman Akzeptierte Antwort
"Could you provide complete sql query?"

The data model is based on a greenhouse with steel supporting ribs every four feet apart. Planting beds lie directly below each rib. Each rib is numbered, with even on the north side, and odd on the south side.

My goal is to produce a report that looks like the physical layout, so our volunteers and students can quickly identify the special needs of each greenhouse planting.

<code>
SELECT
IF(Rib % 2 = 0, gh.Rib, NULL) NRib,
IF(Rib % 2 = 1, gh.Rib, NULL) SRib,
IF(Rib % 2 = 0, CONCAT(plants.genus, ' ', plants.species), NULL) NLatin,
IF(Rib % 2 = 1, CONCAT(plants.genus, ' ', plants.species), NULL) SLatin,
IF(Rib % 2 = 0, gh.Note, NULL) NNote,
IF(Rib % 2 = 1, gh.Note, NULL) SNote,
IF(Rib % 2 = 0, CONCAT(plants.common), NULL) NCommon,
IF(Rib % 2 = 1, CONCAT(plants.common), NULL) SCommon
FROM s_greenhouse_layout_log gh
LEFT JOIN s_plants plants ON gh.plant = plants.id
WHERE gh.Rib < 24
AND (Note NOT LIKE 'DO NOT %' OR Note IS NULL)
GROUP BY gh.Rib
</code>

I made a report that I hoped would work, but it resulted in alternating blanks where the NULLs end up.

I tried changing data/datasource/query, thinking I could use separate queries for the left and right half, but apparently, that is global to the report. I tried using sub reports for the two columns, but got bogged down in some problem — if you think that is a fruitful approach, I can go work on it some more.

I think allowing multiple queries on the same report would solve this problem (and I can see how it could be generally useful beyond this one case), but I haven't been able to figure that out from looking at the videos and tutorials.

Thanks in advance for any advice offered!
Anhänge
Kommentar
There are no comments made yet.
Jan Steinman Akzeptierte Antwort
One other thing I noticed that I saw on a tab in the query editing modal dialogue, was parameters.

How do parameter values get changed? I could not see any way in the report to pass a parameter in to modify a query.

If I could tell the query to show ever or odd via a parameter that is based on information from the report, that might do what I want. I started down that path, but couldn't figure out how to change the parameter.
Anhänge
Kommentar
There are no comments made yet.
Sergey Pashkov Akzeptierte Antwort
There are two uses for these parameters:
1. Parameters can be changed in code, using ADK method VReport.SetParameterValue.
2. Parameters are used for subreports to link query of the subreport to the query of the main report
Kommentar
There are no comments made yet.
Sergey Pashkov Akzeptierte Antwort
Looks like subreports can work here like you've described.

One subreport can print the left part and the second - the right part.

Each subreport has own query, and it can be linked to the main report.
Kommentar
There are no comments made yet.
Jan Steinman Akzeptierte Antwort
Thanks for the encouragement, Sergey. I will go take another look at subreports. I can't recall why I stopped going down that path before...
Kommentar
There are no comments made yet.
Jan Steinman Akzeptierte Antwort
Thanks, Sergey.

I think I'm getting somewhere with sub reports, but I'm having font problems. The text shows up fine in Valentina Studio, but when either printed or exported as PDF, some of the text is a mess.

Any suggestions?
Kommentar
There are no comments made yet.
Jan Steinman Akzeptierte Antwort
Thanks, Sergey.

I think I'm getting somewhere with sub reports, but I'm having font problems. The text shows up fine in Valentina Studio, but when either printed or exported as PDF, some of the text is a mess.

First image below is a screenshot from within Valentina Studio, the second is from Preview of the PDF.

Any suggestions?
Anhänge
Kommentar
There are no comments made yet.
Sergey Pashkov Akzeptierte Antwort
Do you create a PDF via "Export" button of the main toolbar or via print dialog?
And issue happens always with one font? Is it possible to change to another font and it is ok?
Kommentar
There are no comments made yet.
Jan Steinman Akzeptierte Antwort
Sergey Pashkov wrote:
Do you create a PDF via "Export" button of the main toolbar or via print dialog?


I created the PDF via "Export," and also printed directly using the print dialog, which looks the same.

I use that font regularly from other applications (Apple Pages, Numbers, etc.) and it seems to work well in those cases

And issue happens always with one font? Is it possible to change to another font and it is ok?


I used a different version of that font (Souvenir Light SSi rather than Souvenir Lt BT), and it seems to print properly.

I just used that font (Souvenir Lt BT) from Apple Numbers (3.6.2), and it printed perfectly.

Do I need to file a bug report? Should I include a copy of the font file?
Kommentar
There are no comments made yet.
Sergey Pashkov Akzeptierte Antwort
Yes, please, file a bug with a copy of the font.
Kommentar
There are no comments made yet.
  • Seite :
  • 1


There are no replies made for this post yet.
However, you are not allowed to reply to this post.

Categories

Announcements & News
  1. 0 subcategories
Valentina Studio
  1. 2 subcategories
Valentina Server
  1. 4 subcategories
Valentina Database ADK
  1. 0 subcategories
Valentina Reports ADK
  1. 0 subcategories
Other Discussions
  1. 2 subcategories
BETA Testing
  1. 0 subcategories
Education & Research
  1. 0 subcategories