SQL Details in Export Data

For some reason this {REPORT SQL DETAILS:<handler>:<fields>:<delimiter>} syntax doesnt work in v5.5.4.

[Export:0]
Date,Food,SoftDrink,Beer,Wine,Cocktails,Spirits,Cigarette,Other,Total

{REPORT SQL DETAILS:@@OrdersByTagNameV2:F.Date,F.TicketNumber,F.Food,F.SoftDrink,F.Beer,F.Wine,F.Cocktails,F.Spirits,F.Cigarettes,F.Misc::"{0}","{1}","{2}","{3}","{4}","{5}","{6}","{7}","{8}","{9}"}

Though for the exact same script handler it works in visual explorer (without the delimiter)

@VehbiEmiroglu

I ran a trace on whats happening on SQL Server. So this is from visual report explorer. It executes correctly and {Start} / {End} are replaced with dates of my selection.

This is for Data Export. When query is executed, it still hasnt replaced {Start} / {End} with dates of my selection.

I don’t understand why you are using a handler in that tag. That tag is designed so you can run pure sql inside the tag and not use a script.

Because thats how its documented.

When you run pure SQL directly from the report tag it gets escaped by the ; symbol.

As you can see, there is only a first line of code getting executed. Either way, its not working properly.

@Jesse

So after it failed, I was like - screw it - and removed all the ; from the SQL script and run it through the {REPORT SQL DETAILS:} tag and it worked. :sweat_smile:

Nonetheless, maybe these details should be mentioned somewhere about the export how to use it and how not to use it.

1 Like