I'm not sure this can be done in XSLT. I guess you would need to create an extension to return the number of days in a given month. Probably not something that is hard to do if you have the proper .NET/C# skills.
Don't know if this kind of extension exists in uComponents though.
Did you check that your two variables are actually filled in with a value that is not empty and castable to an int? This error can happen if you pass e.g. an empty string to the method.
Sorry I am late for your answer, just wake up and check your post. In your xslt you forgot to check either qryyear and qrymonth contains value of not. Here is solution
<xsl:if test="$qryyear!='' or $qrymonth!=''"> <xsl:value-of select="GetDays:GetDaysCount($qryyear,$qrymonth)"/> </xsl:if>
Can you maybe mark Pasang's previous post as answer to your question? This can help other people who might have similar issues in finding a solution. Thanks!
However it's not always a good idea or a best practice to use inline C# inside XSLT files. Prefferably one should make an extension, which could take the needed parameters.
Just saying this so people don't get wrong habbits. Sometimes it's at a lower scale where it does not matter that much and you really just need to be pragmatic. But once you work on a larger project something like this could hurt performance :-)
the function of many days in a month
Here have a function to calculate the months days?
e.g 2011/2 = 28 days, 2012/2 = 29 days or 2010/4 = 30 days etc...
thx alot :)
Regards,
Bambe
Hi Bambe
I'm not sure this can be done in XSLT. I guess you would need to create an extension to return the number of days in a given month. Probably not something that is hard to do if you have the proper .NET/C# skills.
Don't know if this kind of extension exists in uComponents though.
/Jan
Hi Bambe,
May be this will help you
Pnima
Hi, Pasang
Thanks for your solution :)
Hi, Pasang
Sorry have a problem
I use the GetDays:GetDaysCount() function and insert two variable to it like this: GetDays:GetDaysCount($year,$month)
and save then but tell something: System.OverflowException: Value was either too large or too small for an Int32
here is my code...
how can I solve it ? thx :)
Hi Bambe,
Did you check that your two variables are actually filled in with a value that is not empty and castable to an int? This error can happen if you pass e.g. an empty string to the method.
Cheers,
Michael.
Hi Michael,
I'm sure here have a value
but when I press save button in xslt editor then says the error message
so how can I do :(
thx alot :)
Hi Bambe
What happens if you simply just check "Skip error testing"? Does it fail in the frontend then or is it working?
/Jan
Hi Jan,
it's saying 'Error parsing XSLT file: \xslt\EventList.xslt'
:(
Hi Bambe,
Sorry I am late for your answer, just wake up and check your post. In your xslt you forgot to check either qryyear and qrymonth contains value of not. Here is solution
I've tested this in mine also and error is gone
Hope this helps you
Pnima
Hi Pasang,
that's amazing! :P
the solution are fully solved my problem
Thank you very much :)
Regards,
Bambe :)
You are most welocme Bambe. Glad to hear you did solved you problem.
Pnima
Hi Bambe,
Can you maybe mark Pasang's previous post as answer to your question? This can help other people who might have similar issues in finding a solution. Thanks!
Cheers,
Michael.
Hi Michael,
hmm..
I had already marked the answer yesterday :P
have you seen it??
Regards,
Bambe :)
Woops...
Did not pay enough attention this morning apparently. I guess I need some more coffee :-)
Cheers,
Michael.
Hi guys
I'm glad to see this issue has been resolved.
However it's not always a good idea or a best practice to use inline C# inside XSLT files. Prefferably one should make an extension, which could take the needed parameters.
Just saying this so people don't get wrong habbits. Sometimes it's at a lower scale where it does not matter that much and you really just need to be pragmatic. But once you work on a larger project something like this could hurt performance :-)
/Jan
is working on a reply...