logo

Warning: The forum is now for consultation only. Please use GitHub Discussions to post any questions or comments.


Welcome Guest ! To enable all features please Login or Register.

Notification

Icon
Error

Options
Go to last post Go to first unread
ainaz_ama  
#1 Posted : Sunday, October 4, 2020 12:39:55 PM(UTC)
ainaz_ama

Rank: Newbie

Groups: Registered
Joined: 9/29/2020(UTC)
Posts: 0
Iran (Islamic Republic Of)

Thanks: 2 times
I am working with seal reports to make reports but the problem is our date should be in persian form.
I want to change the date picker in seal report to persian one how should I do it?
Actually I have done it but it does not work, I copied my persianDatePicker javascript and css files to the path of seal report repository path and I changed some code in common.js as:

$(".datepicker_datetime").datetimepicker({
showClose: true,

format: 'YYYY/MM/DD',

});


$(".datepicker_date").pDatepicker({
showClose:true,

format: 'YYYY/MM/DD'

});
I also changed the Use custom template text to True in the seal report designer and also I add these code lines to the template as follows:

@Raw(report.AttachCSSFile("persian-datepicker.min.css"))
@Raw(report.AttachScriptFile("persian-date.min.js"))
@Raw(report.AttachScriptFile("persian-datepicker.min.js"))

but the report is empty although I have added elements to it and also a restriction on Date column of my table with (Prompt at Execution)

Would you please help me with this problem?
Thanks in advance,
Aynaz


epf  
#2 Posted : Monday, October 5, 2020 6:36:08 AM(UTC)
epf

Rank: Administration

Groups: Administrators
Joined: 12/20/2013(UTC)
Posts: 1,209
Switzerland

Thanks: 14 times
Was thanked: 205 time(s) in 198 post(s)
can you try to add 2 JS in the Views\Scripts\i18n subfolders of your repository:
one for moment.js got from https://github.com/momen...tree/develop/dist/locale
one for the picker got from https://github.com/snapa...v1.13.0-dev/dist/js/i18n

then change your default culture in the Server Manager or in the Report it should be dynamic as it is loaded in Report.cshtml with:
Code:
    @if (view.CultureInfo.TwoLetterISOLanguageName != "en")
    {
        @Raw(report.AttachScriptFile("i18n\\moment." + view.CultureInfo.TwoLetterISOLanguageName + ".js"))
        @Raw(report.AttachScriptFile("i18n\\selectpicker." + view.CultureInfo.TwoLetterISOLanguageName + ".min.js"))
    }


For translations, check also https://sealreport.org/Recipes#lineTranslations


Good luck.
thanks 1 user thanked epf for this useful post.
ainaz_ama on 10/10/2020(UTC)
ainaz_ama  
#3 Posted : Tuesday, October 13, 2020 5:46:53 AM(UTC)
ainaz_ama

Rank: Newbie

Groups: Registered
Joined: 9/29/2020(UTC)
Posts: 0
Iran (Islamic Republic Of)

Thanks: 2 times
Thank you for your reply, but it seems that this does not work, I did all this but date picker still displays Gregorian calendar to select from.

Thanks
ainaz_ama  
#4 Posted : Saturday, November 7, 2020 11:52:41 AM(UTC)
ainaz_ama

Rank: Newbie

Groups: Registered
Joined: 9/29/2020(UTC)
Posts: 0
Iran (Islamic Republic Of)

Thanks: 2 times
Hi,

I download the files moment.fa.js from https://github.com/momen...tree/develop/dist/locale and
selectpicker.fa.min.js from https://github.com/snapa...v1.13.0-dev/dist/js/i18n
and copied these two files to \ProgramData\Seal Report Repository\Views\Scripts\i18n
and in the (seal report) server manager - configuration- configure server - I set the culture to Persian BUT it did not work and date picker still shows Gregorian dates to be selected instead of Persian dates.

Would you please help me with this problem?

Thanks in advance
epf  
#5 Posted : Friday, November 13, 2020 6:11:55 PM(UTC)
epf

Rank: Administration

Groups: Administrators
Joined: 12/20/2013(UTC)
Posts: 1,209
Switzerland

Thanks: 14 times
Was thanked: 205 time(s) in 198 post(s)
It looks like the version of moment used in Seal Report is not the last one you have used to download your files...
So you have to update also moment.min.js located in the folder above (but not tested so far).
OR
Just copy the moment.fr.js file and rename it to moment.fa.js, then edit it...
Same remark for selectpicker.fr.min.js

It is easy to change the labels and format.


Users browsing this topic
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.