We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Load report error messy code

Hello

With VS2012+MVC4+EntityFramework4.5,  language: c#, operating system: windows 7 64-bit, the control's version is  12.1.0.43.

I've save the report to database. while reloading it ,there is a error ,because the name of measure member in my report contains Chinese , when reloading it became messy code, so it can not being find in the cube.



    public Dictionary<string, object> SaveReportToDB(string reportName, string olapReport, string clientReports)
        {
            //SqlConnection con = new SqlConnection() { ConnectionString = conStringforDB };
            con.Open();
            SqlCommand cmd1 = new SqlCommand("insert into ReportsTable Values(@ReportName,@Reports)", con);
            cmd1.Parameters.Add("@ReportName", reportName);
            cmd1.Parameters.Add("@Reports", Utils.GetReportStream(clientReports).ToArray());
            cmd1.ExecuteNonQuery();
            con.Close();
            return null;
        }

    public Dictionary<string, object> LoadReportFromDB(string reportName, string olapReport, string clientReports)
        {
            OlapDataManager DataManager = new OlapDataManager(connectionString);
            var reportString = "";
            foreach (DataRow row in GetDataTable().Rows)
            {
                if ((row.ItemArray[0] as string).Equals(reportName))
                {
                    reportString = Utils.CompressData(row.ItemArray[1] as byte[]);
                    break;
                }
            }
            DataManager.Reports = olapClientHelper.DeserializedReports(reportString);
            DataManager.SetCurrentReport(DataManager.Reports[0]);
            return olapClientHelper.GetJsonData("toolbarOperation", DataManager, "Load Report", reportName);
        }

I've debugged ,when saving and reloading the two  binary streams  are not  the same.

Could you help me?Thank you !


17 Replies

EC echo July 29, 2014 06:01 AM UTC

I‘ve make some changes on the code ,
  public Dictionary<string, object> SaveReportToDB(string reportName, string olapReport, string clientReports)
        {
....
  cmd1.Parameters.Add("@Reports", Utils.GetReportStream(clientReports).ToArray()); 
....
}
I changed  the code into 
cmd1.Parameters.Add("@Reports", Utils.DecompressData(clientReports).ToArray());

then two  binary streams  are same,but the error still exists..

   public Dictionary<string, object> InitializeOlapGrid(string action, string olapReport, string gridLayout)
        {
            OlapDataManager DataManager = new OlapDataManager(connectionString);
            if (DataManager.ConnectionString.ToLower().Replace(" ", String.Empty).Split(';', '=').Contains("localeidentifier"))
            {
                DataManager.Culture = new System.Globalization.CultureInfo(cultureIDInfoVal);
                DataManager.OverrideDefaultFormatStrings = true;
            }
            DataManager.SetCurrentReport(Utils.DeserializeOlapReport(olapReport));
            return olapClientHelper.GetJsonData(action, DataManager, gridLayout);
        }

  public Dictionary<string, object> InitializeOlapChart(string action, string customObject)
        {
            OlapDataManager DataManager = new OlapDataManager(connectionString);
            DataManager.SetCurrentReport(Utils.DeserializeOlapReport(serializer.DeserializeObject(customObject).ToString()));

            return htmlHelper.GetJsonData(action, DataManager);
        }

the bold  and underlined code is where the error exists


AD Alagarsamy D Syncfusion Team July 30, 2014 09:26 AM UTC

Dear Customer, 


Thank you for using Syncfusion products. 


We would very much appreciate if you could provide us a sample project and mdf/sdf database file replicating the scenario. It will help us to investigate further. 


Please let us know if you have any concerns.

Thanks,

Alagarsamy D.  



EC echo July 31, 2014 07:01 AM UTC

This is my project .

When using the example data source  http://bi.syncfusion.com/olap/msmdpump.dll  ,these two functions are normal.

But when using my own Olap DataSource, the function  of Save Report  is normal, but Load Report is not.




Attachment: ES122Demo_ddc9c2f2.rar


TM Tamilarasu M Syncfusion Team August 4, 2014 12:17 PM UTC

Dear Customer,

The provided sample doesn’t work at out end because connection string provided works only at your local machine (environment). Please provide either a cube file or host your cube online (via SSAS server) so that we will be able to check it from our end.

Thanks,

Tamilarasu.M



EC echo August 5, 2014 02:13 AM UTC

There is a file named SSASZHDemo.abf in directory of dataSource. It is the bak of my cub. You can recovery in your local SSAS server


TM Tamilarasu M Syncfusion Team August 5, 2014 10:34 AM UTC

Dear Customer.

Thanks for the update.

With the provided data we can able to restore the abf file. But there is a problem while restoring master.bak file. Please find the attached screen shot for error description. We kindly recommend you to provide appropraite bak, sdf or mdf file so that we will be able to check it at our end.

Thanks,

Tamilarasu.M


Attachment: Issue_5f4ee818.zip


EC echo August 6, 2014 04:46 AM UTC

Sorry ,it seemed that there is an error when recovery master.bak.

I make some changes in my demo.

I create a new database named Report.In the directory of dataSource exists a mdf file,it is my database file. There is also my cub file .

You can use them as your convenience.

Attachment: ES122Demo_e864dccd.rar


TM Tamilarasu M Syncfusion Team August 7, 2014 06:55 AM UTC

Dear Customer,

Thanks for the update with the provided data. We have attached Database but while saving report we getting exception “Login failed for user 'sa'.” Please provide necessary authentication details to proceed further to resolve the reported problem. Please find the attached screenshot for more details.

Thanks

Tamilarasu.M


Attachment: login_failed_issue_164b7c36.zip


EC echo August 8, 2014 01:14 AM UTC

in the file of OlapClientService.svc you can find this

 private SqlConnection con = new SqlConnection("Data Source=.;Initial Catalog=Report;Persist Security Info=True;User ID=sa;Password=pass;");

change the  User ID and Password .


TM Tamilarasu M Syncfusion Team August 8, 2014 09:08 AM UTC

Dear Customer,
 
We have already tried with the provide snippet. But we are getting exception as "Login failed for sa". Please find the attachment for more details and we would very much appreciate if you could provide database without any authentication.
 
Thanks,
Tamilarasu.M

Attachment: connection_issue_cc13d599.zip


EC echo August 11, 2014 01:50 AM UTC

what is your database ? my database is sqlserver 2012. 

if yours is also sqlserver,then try to change the connection to  Windows authentication mode .

try  to use the connection strings as below.
private SqlConnection con = new SqlConnection("Data Source=.;Initial Catalog=Report;Trusted_Connection=Yes;");







TM Tamilarasu M Syncfusion Team August 11, 2014 01:35 PM UTC

Dear Customer,

 We are analyzing with the given data we will update you in one business day August 12, 2014.

 Thanks,

Tamilarasu.M



TM Tamilarasu M Syncfusion Team August 12, 2014 01:30 PM UTC

Dear Customer,

 

Thanks for your patience.

 We kindly recommend you to use English language for the properties such as unique name and name. In-order to view any localized language we have a separate property known as “Caption” while creating cube which we will be utilized and reflected in our control. “Caption” property is more than sufficient to view the localized text.

 Sorry for the inconvenience caused if any.

 

Thanks,

Tamilarasu.M​



EC echo August 14, 2014 08:30 AM UTC

Thank you.

In fact I need to use Chinese in my cub ,including the name of dimensions and measures.So it is a bit difficult for me to do as you advised.

Besides,I want to know more information about the property of "Caption"  . How to do with it in the version of 12.1.0.43? Can give me a  sample for this ? Thank you .


TM Tamilarasu M Syncfusion Team August 18, 2014 01:18 PM UTC

Dear Customer,

 

Cube Caption property is used to provide multiple language support for Olap Cube without changing the unique name. User can add the localized string to the caption property for every part of cube (such as dimension measure and hierarchy etc...).And on setting locale identifier in the connection string our control will automatically get the localized caption information from the cube.

 

Please the online document for Localization below

 

http://help.syncfusion.com/ug/js/documents/localization2.htm

 

Thanks

Tamilarasu.M



EC echo August 20, 2014 07:33 AM UTC

Thank you .But I am afraid  you have got it wrong .Of course the new version of OlapClient is support Chinese. But I mean my olap datasource include chinese characters. The OlapClient can show the data and save a report  successfully .But when I reload one of the saved report ,then there occurs error.

the error means [ Sparked a System.Xml.XmlException: "?" "(Hexadecimal value 0x0F) is invalid character line 1, position 2632.." ]

Until now, most of the errors I encountered similar to the one above . I was a little skeptical that  this error was caused by  a binary stream error handling.. So I need your help to find out why .

Please find the attached screen shot for where  error occurs.


Attachment: error_9b63d337.rar


AD Alagarsamy D Syncfusion Team August 26, 2014 11:22 AM UTC

Dear Customer,

 

We have logged this as a improvement request in our database. We will implement this feature in any of our upcoming releases. We will update you once this feature has been implemented.

 

http://www.syncfusion.com/support/directtrac/features/JS-5310

 

Thanks,

Alagarsamy D


Loader.
Live Chat Icon For mobile
Up arrow icon