Time clock blank report save/print 5.1.47+ (inc .49)

I am using the time clock implementation by @Jesse

Any time clock reports (either detailed or individual employee) when save or print, they are blank except for the header. Viewing the report in SambaPOS is fine. See below example of report saved to XPS format:

I have checked, all other reports (built in and custom reports I created) work fine, for save and print). Only those associated with time clock are blank.

That tutorial is old it used Table view… I do not use that anymore because V5 supports better tags to get the totals. Previously in v4 I had to use table view to get the totals of columns. Ill post the new reports for you in a bit.

But to print your report you can enable Visual Printing from within the report editor. All Table view or Pivot Table view reports have to have Visual Printing enabled from the report editor.

2 Likes

Ok thanks, will wait for your new reports. :smile:

BTW what exactly does “visual printing” option do?

Table View and Pivot Table view for reports is a graphical representation of the report. The extra columns etc does not actually exist in the report. Your basically turning it into a graphic. I used Table view in the old reports because back then we did not have tags for the totals columns etc. Now we do and we also have scripting so we dont have to define names in the reports either for the users or entities.

2 Likes

@markjw I do not have the original reports anymore Can you show me the report syntax of yours so I can demonstrate the changes I am talking about?

Try this:

@{CALL:SA.getusers()}

[$1:1,.8,.8,.6,.6, .5, .5, .5]

>Employee|In Date|Out Date|PunchIn|PunchOut|Hours|Pay Rate|Wages

{REPORT ENTITY STATE DETAILS:L.EntityName,L.StartDate,L.EndDate,L.StartTime,L.EndTime,=F([L.Hours]),CD.Pay Rate,=([CD.Pay Rate])*F([L.Hours]):(ELSN=TCStatus) AND EntityStateLog.GetHours()>0 AND (ELSS=PunchIn) AND (ELEN=$1)}

>||||||Total Wages:   ${REPORT ENTITY STATE DETAILS:([CD.Pay Rate])*([L.Hours]).Sum:(ELSN=TCStatus) AND EntityStateLog.GetHours()>0 AND (ELSS=PunchIn) AND (ELEN=$1)}

Here is script:

Handler: SA

function getusers(){

var qry = "SELECT [Name] FROM [Users]";

var r = sql.Query(qry).Join(',');

return r;

}
1 Like

Here are the original reports you created from your tutorial:

All Detail Wage Report

[#Detailed Wages:1,.8,.8,.6,.6, .5, .5, .5]
>Name|In Date|Out Date|PunchIn|PunchOut|[C]Hours|[C]Pay Rate|[C]Wages
{REPORT ENTITY STATE DETAILS:L.EntityName,L.StartDate,L.EndDate,L.StartTime,L.EndTime,=F([L.Hours]),CD.Pay Rate,=M(F([CD.Pay Rate])*F([L.Hours])):(ELSN=TCStatus) AND EntityStateLog.GetHours()>0 AND (ELSS=PunchIn)}

(Employee) Detail Wage Report (e.g. Jenny)

[#Detailed Wages:1,.8,.8,.6,.6, .5, .5, .5]
>Name|In Date|Out Date|PunchIn|PunchOut|[C]Hours|[C]Pay Rate|[C]Wages
{REPORT ENTITY STATE DETAILS:L.EntityName,L.StartDate,L.EndDate,L.StartTime,L.EndTime,=F([L.Hours]),=M([CD.Pay Rate]),=M(F([CD.Pay Rate])*F([L.Hours])):(ELSN=TCStatus) AND EntityStateLog.GetHours()>0 AND (ELSS=PunchIn) AND (ELEN=Jenny)}

Try the report I showed above with the script I think you will like it. If your just using entities not users I can show the script for that as well the report would be same.

1 Like

I tried just enabling Visual Printing without changing the original reports, but still the XPS file saved is blank. Did I misunderstand that alone it is not enough?

I will recreate the reports based on what you said when I get a chance later.

Thanks. Using both users and entities for the moment.

Your linking them right? I’ll give you an improved script more specific to your use in few minutes.

Try this script instead of the one above. Its more precise.

function getusers(){

var qry = "SELECT e.[Name] FROM [Entities] e JOIN [EntityTypes] et on et.[Id]=e.[EntityTypeId] WHERE et.[Name] = 'Employees' ORDER BY e.[Name]";

var r = sql.Query(qry).Join(',');

return r;

}

Yes - well just same as you said in your tutorial - username and password identical on both user and entity.

But anyway the report works on screen so don’t think it’s anything to do with linking.

No no that question was more for me. I was trying to tailor a script for you. My thread above the new script try it instead. This means you wont have to hardcode names into individual reports… One report will work for all employees and new employees will automatically generate on the report.

Visual Reports may not export correctly to a XPS file…I have not tested that but it makes sense they would not. They are really meant just for a way to customize a report for viewing not really for saving or printing that view. Its better to get the desired look via regular report if you plan to save them.

Like I said the only reason I even used the visual reports options was because at the time we could not total up those columns with report tags. Now we can.

1 Like

Sorry for late reply, I just tried this out and it isn’t working. Can’t work out what is wrong.

For the same date range and data, this is the old All Detail Wage Report:

And this is the new one, using exactly your code:

I’ve checked it over and over and I can’t work out what is wrong. :confused:

EDIT: I am using 5.1.53

I have some better code for you give me a bit ill show you.

Be sure your on latest version and not 5.1.51 there was a bug with report tags.

@markjw

We can improve this but try this:

[Detailed Wages:1,.8,.8,.6,.6, .5, .5, .5]
@{ENTITY STATE ENTITY LIST:(ELSN=TCStatus) AND (ELSS=PunchIn)}
>Employee|In Date|Out Date|PunchIn|PunchOut|Hours|Pay Rate|Wages
{REPORT ENTITY STATE DETAILS:L.EntityName,L.StartDate,L.EndDate,L.StartTime,L.EndTime,=F([L.Hours]),CD.Pay Rate,=([CD.Pay Rate])*F([L.Hours]):(ELSN=TCStatus) AND EntityStateLog.GetHours()>0 AND (ELSS=PunchIn) AND (ELEN=$1)}
>>Total Wages:   ${REPORT ENTITY STATE DETAILS:([CD.Pay Rate])*([L.Hours]).Sum:(ELSN=TCStatus) AND EntityStateLog.GetHours()>0 AND (ELSS=PunchIn) AND (ELEN=$1)}

PS: Neither of those require a script. I dont have a lot of employee data on my test machine I hope you do and can let me know how those reports look.

PS2: I noticed a flaw and reposted new code.

EDIT: Ok one last time I fixed syntax again try new one.

2 Likes

Slightly different variation:

[Detailed Wages:1,.8,.8,.6,.6, .5, .5, .5]
@{ENTITY STATE ENTITY LIST:(ELSN=TCStatus) AND (ELSS=PunchIn)}
>Employee|In Date|Out Date|PunchIn|PunchOut|Hours|Pay Rate|Wages
{REPORT ENTITY STATE DETAILS:L.EntityName,L.StartDate,L.EndDate,L.StartTime,L.EndTime,=F([L.Hours]),CD.Pay Rate,=([CD.Pay Rate])*F([L.Hours]):(ELSN=TCStatus) AND EntityStateLog.GetHours()>0 AND (ELSS=PunchIn) AND (ELEN=$1)}
>>Total Wages:   ${REPORT ENTITY STATE DETAILS:([CD.Pay Rate])*([L.Hours]).Sum:(ELSN=TCStatus) AND EntityStateLog.GetHours()>0 AND (ELSS=PunchIn)}

1 Like

A third variation:

[Detailed Wages:1,.8,.8,.6,.6, .5, .5, .5]
@{ENTITY STATE ENTITY LIST:(ELSN=TCStatus) AND (ELSS=PunchIn)}
>Employee|In Date|Out Date|PunchIn|PunchOut|Hours|Pay Rate|Wages
{REPORT ENTITY STATE DETAILS:L.EntityName,L.StartDate,L.EndDate,L.StartTime,L.EndTime,=F([L.Hours]),CD.Pay Rate,=([CD.Pay Rate])*F([L.Hours]):(ELSN=TCStatus) AND EntityStateLog.GetHours()>0 AND (ELSS=PunchIn) AND (ELEN=$1)}
>>|||||{REPORT ENTITY STATE DETAILS:L.Hours.Sum,CD.Pay Rate.average,([CD.Pay Rate])*([L.Hours]).Sum:(ELSN=TCStatus) AND EntityStateLog.GetHours()>0 AND (ELSS=PunchIn)}

1 Like