 |
 | Chart Control Rodrigo Brandão | 3:18 16 Nov '09 |
|
 |
What about chart control? it doesnt have LocID for Legend.
tks Rodrigo
|
|
|
|
 |
 | Thank you Member 2018497 | 13:27 30 Oct '09 |
|
 |
Good solution for WinForm application, thanx !
|
|
|
|
 |
 | Best Localization Plug-in for Visual Studio. Alexander Nesterenko | 22:36 17 Dec '08 |
|
 |
Move strings from code to resx and translate their automatically. Try RGreatEx[^] free.
--- Best regards, Alexander Nesterenko Safe Develop Team www.safedevelop.com
|
|
|
|
 |
 | SubReport problem galodoido | 6:06 15 Sep '08 |
|
 |
Hello, do you help me ? I Have a problem.
I have a subreport in my localreport. But in the method LocalizeReport, after the command report.LoadReportDefinition i'm call the method LoadSubreportDefinition however my subreport isn't globalized.
Each subreport have your resource.
I need globalization eache subreport of mey report contains.
thanks
|
|
|
|
 |
|
 |
The following is what I'm using. I'm very new at coding for xml, so it was a struggle working out how to navigate. So I'm sure someone will know how better to search for the node. I also wasn't able to work out what to do if a sub report had its own subreports (if that's possible).
private void ProcessReport(LocalReport report) { // I use an event to process the xml as I might want to // change the processing depending on the report // and this is a generic report processor. if (OnProcessXmlEvent != null) {
string nameSpace = GetNamespace(report.ReportEmbeddedResource); const string rdlc = ".rdlc"; string reportName = report.ReportEmbeddedResource;
XmlNamespaceManager manager; XmlDocument document = GetDocument(out manager, reportName);
if (document.DocumentElement != null) { // Call event to process xml OnProcessXmlEvent(reportName, document, manager);
report.ReportEmbeddedResource = string.Empty; using (StringReader outputStream = new StringReader(document.DocumentElement.OuterXml)) { report.LoadReportDefinition(outputStream); }
// Read in each subreport name foreach (XmlNode node in document.DocumentElement.SelectNodes("/nm:Report/nm:Body/nm:ReportItems/nm:Subreport/nm:ReportName", manager)) { // Process each subreport string fullPath = nameSpace + node.InnerText + rdlc; XmlNamespaceManager subReportManager; XmlDocument subReportDocument = GetDocument(out subReportManager, fullPath); if (subReportDocument.DocumentElement != null) { // Callback to process whatever's needed in the subreport OnProcessXmlEvent(fullPath, subReportDocument, subReportManager); using (StringReader outputStream = new StringReader(subReportDocument.DocumentElement.OuterXml)) { report.LoadSubreportDefinition(node.InnerText, outputStream); } } }
} //if (document.DocumentElement != null) }
}// function
// Returns an XLM document for the report private XmlDocument GetDocument(out XmlNamespaceManager manager, string reportName) { XmlDocument result = new XmlDocument(); using (Stream stream = Assembly.GetExecutingAssembly().GetManifestResourceStream(reportName)) { if (stream != null) { result.Load(stream); manager = new XmlNamespaceManager(result.NameTable); manager.AddNamespace("nm", "http://schemas.microsoft.com/sqlserver/reporting/2005/01/reportdefinition"); manager.AddNamespace("rd", "http://schemas.microsoft.com/SQLServer/reporting/reportdesigner"); return result; } throw new Exception("Stream = null"); } }// function
// The following is example event handler I use to process one of my reports private static void OnProcessXml(string reportName, XmlDocument document, XmlNamespaceManager manager) { if (reportName.ToUpper() == C_REPORT_DAILY_SUBREPORT.ToUpper()) { if (document.DocumentElement != null) { // Make legend invisible in this report foreach (XmlNode node in document.DocumentElement.SelectNodes( "/nm:Report/nm:Body/nm:ReportItems/nm:List/nm:ReportItems/nm:Chart/nm:Legend/nm:Visible", manager)) { node.InnerText = C_FALSE.ToLower(); } // do localization as in original author's article LocaliseDocument(document); } } }// function
|
|
|
|
 |
 | Precompiled web Member 4118340 | 0:21 11 Sep '08 |
|
 |
Hello when the web is precompiled the function fails, does not find the file with extension .rcp
Ideas? Thank you
|
|
|
|
 |
|
 |
I precomilied the web and didn't get any rcp file. What version of Visual Studio do you use?
|
|
|
|
 |
|
 |
Visual Studio 2005, Framework 2.0
|
|
|
|
 |
|
 |
Thanks, I’ve made some changes in the code – I moved report’s resource files under App_LocalResources folder. Please try new version.
|
|
|
|
 |
|
 |
I believe that it is not a problem of the code, the problem this one in the precompiled
If Precompiled your example, it continues failing. It works if I copy the original file .rcp to the capeta App_Data
|
|
|
|
 |
|
 |
Would you please send me your precompiled example?
|
|
|
|
 |
 | Execution problem : System.InvalidOperationException chabouni | 4:37 8 Sep '08 |
|
 |
Hello, i tried to use the source code, but i had an execution exception at this line :
String localizedValue = (string)HttpContext.GetLocalResourceObject(virtReportPath, node.Attributes["rd:LocID"].Value);
"La classe de la ressource correspondant à cette page est introuvable. Vérifiez si le fichier de ressources existe et réessayez".
// System.InvalidOperationException: // The resource class for the page was not found.
I tried in vain to resolve it so please i need your help. Thank u.
|
|
|
|
 |
|
 |
Did you create a resource file for the report?
|
|
|
|
 |
|
 |
I’ve made some changes in the code – I moved report’s resource files under App_LocalResources folder. Please try new version.
|
|
|
|
 |
 | Excellent work, I've used it on a win app project andycted | 2:07 3 May '08 |
|
 |
By modifying a couple of lines I've managed to use the same idea in windows applications in a ReportViewer:
- Load the report xml by doing something like this Stream str = Assembly.GetExecutingAssembly().GetManifestResourceStream( report.ReportEmbeddedResource); doc.Load(str); str.Close();
- get your localized strings by ResourcesFile.ResourceManager.GetString(...
- and I don't know why but loading the report from a StringReader didn't work for me, so I did this: File.WriteAllText(tempFile, doc.DocumentElement.OuterXml); reportViewer1.LocalReport.ReportPath = tempFile; and after Refreshing the reportviewer deleting the temporary file
Any idea why loading from the StringReader didn't work ?
Andrea Sabbatini Sviluppo software - Software development www.andreasabbatini.com www.doctorsoffice.it
|
|
|
|
 |
|
 |
I tried your modification. In my case the StringReader didn't work because the Report's ReportEmbeddesResource had the name of the report.
Changing the line:
lr.ReportPath = String.Empty
to:
lr.ReportEmbeddedResource = String.Empty
worked for me.
Is this your case?
|
|
|
|
 |
|
 |
[EDIT][AGAIN] (sorry)
I've just found out that: 1) your method works like a charm. Thanks a lot !
2) for some reason ALL the ValueLocID, LabelLocID, etc have been lost by the project. This dodgy behaviour of visual studio has been going on for some time. Besides every time I open the project and immediately shut it down, it asks to save 'modifications' (what ?)
Ciao Andy
Andrea Sabbatini Sviluppo software - Software development www.andreasabbatini.com www.doctorsoffice.it
modified on Friday, November 14, 2008 2:43 PM
|
|
|
|
 |
|
|
 |
 | RDLC and reporting services
| 0:05 23 Jan '07 |
|
 |
Hi,
I would like to the same think with reporting services. When user is connecting on the portail web. I don't want to create a web application on dot.net. Have you go a solution for me. Thank.
Nadège BAUBANT (French)
|
|
|
|
 |
|
|
 |