PDA

View Full Version : خطای Load report failed در کریستال ریپورت سی شارپ



Kurdia
یک شنبه 28 شهریور 1389, 02:32 صبح
با سلام
می خوا م مقادیری رو به کریستال ریپورد انتقال بدم و گزارشگیری کنم
اما مشکل ایجاد شده Load report failed
اطلاعات از فرم یک به فرم دو می رن

در فرم دو درون متغرهایی قرار می گیرند(تا اینجای کار همه چیز خوب پیش می ره)



idstring = strid;
tblheader = "{" + header + ".ID}= ";
tbldetail = "{" + detail + ".IDHeader}= ";
strpath = "//Report/ReportFrmb1.rpt";

اما با اجرای کدهای کریستالریپورت که Crystalreportviewer با نام crrpt قرار داده شده خطای Load report failed رو می ده!




public void reporting(string mypath,string h,string d, string idstr)
{
ReportDocument rpt = new ReportDocument();
string filePath = Application.StartupPath + mypath;
rpt.Load(filePath);
crrpt.SelectionFormula = h + idstr + " AND " + d + idstr;
crrpt.ReportSource = rpt;
crrpt.Refresh();


}

مشکل کجاست؟؟
اطلاعات هم دی دیتابیس دو جدول قرار دارند
جدول اول tblheader که مثلا مشخصات فرد در اون ذکر شده
جدول دوم tbldetail که اطلاعاتی مانند لیست خرید مربوط به اون شخص درش قرار داده شده
درون فایل همه چی مرتبه
اما برای گزارشگیری با C#‎.Net مشکل دارم
متن خطا
CrystalDecisions.Shared.CrystalReportsException was unhandled
Message="Load report failed."
Source="CrystalDecisions.CrystalReports.Engine"
StackTrace:
at CrystalDecisions.ReportAppServer.ReportClientDocum entWrapper.EnsureDocumentIsOpened()
at CrystalDecisions.CrystalReports.Engine.ReportDocum ent.Load(String filename, OpenReportMethod openMethod, Int16 parentJob)
at CrystalDecisions.CrystalReports.Engine.ReportDocum ent.Load(String filename)
at Bazargani.Reports.reporting(String mypath, String h, String d, String idstr) in H:\Projects\Bazargani Project\Bazargani\Bazargani\Reports.cs:line 50
at Bazargani.Reports.Reports_Load(Object sender, EventArgs e) in H:\Projects\Bazargani Project\Bazargani\Bazargani\Reports.cs:line 36
at System.Windows.Forms.Form.OnLoad(EventArgs e)
at System.Windows.Forms.Form.OnCreateControl()
at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
at System.Windows.Forms.Control.CreateControl()
at System.Windows.Forms.Control.WmShowWindow(Message& m)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ScrollableControl.WndProc(Mes sage& m)
at System.Windows.Forms.ContainerControl.WndProc(Mess age& m)
at System.Windows.Forms.Form.WmShowWindow(Message& m)
at System.Windows.Forms.Form.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.O nMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.W ndProc(Message& m)
at System.Windows.Forms.NativeWindow.DebuggableCallba ck(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
at System.Windows.Forms.UnsafeNativeMethods.SendMessa ge(HandleRef hWnd, Int32 msg, Int32 wParam, Int32 lParam)
at System.Windows.Forms.Form.SetVisibleCore(Boolean value)
at System.Windows.Forms.Control.set_Visible(Boolean value)
at System.Windows.Forms.Application.ThreadContext.Run MessageLoopInner(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.ThreadContext.Run MessageLoop(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.RunDialog(Form form)
at System.Windows.Forms.Form.ShowDialog(IWin32Window owner)
at System.Windows.Forms.Form.ShowDialog()
at Bazargani.FRMB1.BTNPrintH_Click(Object sender, EventArgs e) in H:\Projects\Bazargani Project\Bazargani\Bazargani\FRMB1.cs:line 228
at System.Windows.Forms.Control.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnMouseUp(MouseEventAr gs mevent)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ButtonBase.WndProc(Message& m)
at System.Windows.Forms.Button.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.O nMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.W ndProc(Message& m)
at System.Windows.Forms.NativeWindow.DebuggableCallba ck(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
at System.Windows.Forms.UnsafeNativeMethods.DispatchM essageW(MSG& msg)
at System.Windows.Forms.Application.ComponentManager. System.Windows.Forms.UnsafeNativeMethods.IMsoCompo nentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData)
at System.Windows.Forms.Application.ThreadContext.Run MessageLoopInner(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.ThreadContext.Run MessageLoop(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.RunDialog(Form form)
at System.Windows.Forms.Form.ShowDialog(IWin32Window owner)
at System.Windows.Forms.Form.ShowDialog()
at Bazargani.FrmMain.فرمارزیابیودرجهب ندیپیمانکارToolStripMenuItem_Click(Obje ct sender, EventArgs e) in H:\Projects\Bazargani Project\Bazargani\Bazargani\FrmMain.cs:line 59
at System.Windows.Forms.ToolStripItem.RaiseEvent(Obje ct key, EventArgs e)
at System.Windows.Forms.ToolStripMenuItem.OnClick(Eve ntArgs e)
at System.Windows.Forms.ToolStripItem.HandleClick(Eve ntArgs e)
at System.Windows.Forms.ToolStripItem.HandleMouseUp(M ouseEventArgs e)
at System.Windows.Forms.ToolStripItem.FireEventIntera ctive(EventArgs e, ToolStripItemEventType met)
at System.Windows.Forms.ToolStripItem.FireEvent(Event Args e, ToolStripItemEventType met)
at System.Windows.Forms.ToolStrip.OnMouseUp(MouseEven tArgs mea)
at System.Windows.Forms.ToolStripDropDown.OnMouseUp(M ouseEventArgs mea)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ScrollableControl.WndProc(Mes sage& m)
at System.Windows.Forms.ToolStrip.WndProc(Message& m)
at System.Windows.Forms.ToolStripDropDown.WndProc(Mes sage& m)
at System.Windows.Forms.Control.ControlNativeWindow.O nMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.W ndProc(Message& m)
at System.Windows.Forms.NativeWindow.DebuggableCallba ck(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
at System.Windows.Forms.UnsafeNativeMethods.DispatchM essageW(MSG& msg)
at System.Windows.Forms.Application.ComponentManager. System.Windows.Forms.UnsafeNativeMethods.IMsoCompo nentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData)
at System.Windows.Forms.Application.ThreadContext.Run MessageLoopInner(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.ThreadContext.Run MessageLoop(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.Run(Form mainForm)
at Bazargani.Program.Main() in H:\Projects\Bazargani Project\Bazargani\Bazargani\Program.cs:line 18
at System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args)
at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
at Microsoft.VisualStudio.HostingProcess.HostProc.Run UsersAssembly()
at System.Threading.ThreadHelper.ThreadStart_Context( Object state)
at System.Threading.ExecutionContext.Run(ExecutionCon text executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
InnerException: System.Runtime.InteropServices.COMException
Message="The system cannot find the path specified.\r"
Source="Analysis Server"
ErrorCode=-2147467259
StackTrace:
at CrystalDecisions.ReportAppServer.ClientDoc.ReportC lientDocumentClass.Open(Object& DocumentPath, Int32 Options)
at CrystalDecisions.ReportAppServer.ReportClientDocum entWrapper.Open(Object& DocumentPath, Int32 Options)
at CrystalDecisions.ReportAppServer.ReportClientDocum entWrapper.EnsureDocumentIsOpened()
InnerException:

mmd2009
یک شنبه 28 شهریور 1389, 03:17 صبح
با سلام

برای ارسال مقدار به یک گزارش بهتره از پارامترها استفاده بکنید

اگر خواستی استفاده بکنی بگو تا نمونه برات بذارم.

Kurdia
یک شنبه 28 شهریور 1389, 03:43 صبح
با سلام

برای ارسال مقدار به یک گزارش بهتره از پارامترها استفاده بکنید

اگر خواستی استفاده بکنی بگو تا نمونه برات بذارم.
بله
ممنون می شم

mmd2009
یک شنبه 28 شهریور 1389, 15:07 عصر
با سلام

به این (http://programming.ramiz.ir/index.php?option=com_content&view=article&id=97:1389-06-28-11-01-59&catid=38:1389-05-31-02-33-38&Itemid=44)لینک برید

توجه کن برای انتقال به فرم دیگه هم زیاد سخت نیست کافیه با پاپریتی یا یک تابع مقدار رو براش بفرستی

Kurdia
یک شنبه 28 شهریور 1389, 15:27 عصر
انتقال با موفقیت انجام می شه
و نمی خوام دستکاریش کنم
اطلاعات هم از بانک خوانده می شن
ممنون
الان چک می کنم و ملزومات رو اعمال می کنم

Kurdia
یک شنبه 28 شهریور 1389, 17:40 عصر
نشد
باز هم خطا می ده
من دارم اطلاعات رو از بانک می گیرم اما فایل کمکی شما همچین نمی کنه !
F1 Please

mmd2009
دوشنبه 29 شهریور 1389, 12:52 عصر
خب اطلاعات رو از بانک میگیرید بلاخره که میره یه جایی قرار میگیره مثلا تو یک ارایه. خب اون ارایه رو ببرید به فرم نمایش گزارشتون و بعنوان پارامتر اونو ارسال بکنید.

Kurdia
دوشنبه 29 شهریور 1389, 16:13 عصر
خب اطلاعات رو از بانک میگیرید بلاخره که میره یه جایی قرار میگیره مثلا تو یک ارایه. خب اون ارایه رو ببرید به فرم نمایش گزارشتون و بعنوان پارامتر اونو ارسال بکنید.

چجوری؟؟
وقتی که اطلاعات مثلا به این شکله ؟؟

ممطالب درج شده در tblheader
id
نام
نام خانوادگی

مطالب درج شده در tbldetail
id
idheader مقدار id که از tblheader ارسال می شود در آن قرار می گیرد
درس1
درس2
درس3

-----------------------
جایی که id = 1 اطلاعات tblheader رو نشون می ده و اطلاعاتی که در tbldetail هستند و فیلد tbldetail.idheader = tblheader.id نشون می ده

23 فایل باید ویرایش بشه ! :عصبانی++::گیج: :عصبانی++::گیج: :عصبانی++::گیج:

:متفکر: :متفکر: :متفکر:

Kurdia
پنج شنبه 01 مهر 1389, 08:57 صبح
مشکل حل شد
نمی دونم چرا با اینکه به ذهنم رسید انجام ندادم
پوشه ای که فایل های کریستال ریپورت توش بود رو در محل اجرای نرم افزار کپی نکردم