Hello,
Please show me how you call this function in report? I mean text expression which use this function.
Thank you.
get data, do some processes on them, retrive and display them on report??
get data, do some processes on them, retrive and display them on report??
hello Andrew, Jan, Vladimir and all of the rest in this forum, i would like to tell you that my report and my function are working now exactly as i want.
I really appreciate your help and your great support.
About my last problem it is just small wrong from me, because in the datasourse in stimulsoft report environment under the Date column i put the datatype String, and after i changed it to DateTime my report working properly now.
This is the last code which is working now, and after i did few changes in that application you sent to me.
And in the text editor of the Text Component i wrote this:
{MyClass.GetUserText(DataSource1.EnrDate)}
So my report is working properly now
.
Thank you again.
I really appreciate your help and your great support.
About my last problem it is just small wrong from me, because in the datasourse in stimulsoft report environment under the Date column i put the datatype String, and after i changed it to DateTime my report working properly now.
This is the last code which is working now, and after i did few changes in that application you sent to me.
Code: Select all
namespace MyClassNamespace
{
public class MyClass
{
public static string GetUserText(DateTime greg)
{
GregorianCalendar Grn = new GregorianCalendar();
UmAlQuraCalendar Umq = new UmAlQuraCalendar();
int year = Umq.GetYear(greg);
int month = Umq.GetMonth(greg);
int day = Umq.GetDayOfMonth(greg);
string hijri = year.ToString() + "/" + month.ToString() + "/" + day.ToString();
return hijri;
}
}
}
namespace WebViewer_UserFunction
{
public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
SqlConnection conn = new SqlConnection(General.ConnString);
string sql= "SELECT EnrDate, EnrStudentName FROM nEnrollment";
SqlDataAdapter da = new SqlDataAdapter(sql, conn);
DataSet ds = new DataSet();
da.Fill(ds);
string appDirectory = HttpContext.Current.Server.MapPath(string.Empty);
string reportPart = appDirectory + "\\SampleReport.mrt";
StiReport report = new StiReport();
report.Load(reportPart);
report.RegData(ds);
report.Script = string.Format("using MyClassNamespace;\n{0}", report.Script);
string[] referencedAssemblies = new string[report.ReferencedAssemblies.Length + 1];
report.ReferencedAssemblies.CopyTo(referencedAssemblies, 0);
referencedAssemblies[referencedAssemblies.Length - 1] = "WebViewer_UserFunction.dll";
report.ReferencedAssemblies = referencedAssemblies;
StiWebViewer1.Report = report;
}
}
}
{MyClass.GetUserText(DataSource1.EnrDate)}
So my report is working properly now

Thank you again.
- Attachments
-
- 380.SampleReport.mrt
- (6.65 KiB) Downloaded 219 times
get data, do some processes on them, retrive and display them on report??
Thank you for your post! That will be very helpful for all forum community.