The problem with Spreadsheet.Show() function (for charts) in 1C:Enterprise v8.3.7

The 1C:Enterprise developers forum

#1
People who like this:0Yes/0No
Active user
Rating: 2
Joined: Aug 10, 2012
Company: N/A

Hi Admin,

This code block is performed with 1C:Enterprise v8.3.7 unsuccessfully (there is NO problems with the previous versions of 1C:Enterprise, such as 8.3.4).
Please take a look at the attachment screenshot (error_msg.png).

Could you please help me investigate the problem?

Code
&AtClient
Procedure Print(Command)
   Spreadsheet = New SpreadsheetDocument;   
   XemIn(Spreadsheet);
   Spreadsheet.ShowGrid = False;
   Spreadsheet.ReadOnly = True;
   Spreadsheet.ShowHeaders = False;
   
   Spreadsheet.PageOrientation = PageOrientation.Landscape;
   Spreadsheet.FitToPage = True;
   Spreadsheet.Show();   
EndProcedure

Procedure XemIn(Spreadsheet)
      
   Template = Reports.BieuDoDoanhSoTheoNgay.GetTemplate("MauBieu");
   
   TenDonVi = LicensedServer.GetTenDonVi();
   DiaChi = "Địa chỉ: " + LicensedServer.GetDiaChi();
   DienThoai = "Điện thoại: " + LicensedServer.GetDienThoai();
   
   TuNgay = BegOfDay(Object.TuNgay);
   DenNgay = EndOfDay(Object.DenNgay);
   
   BieuDo = Template.GetArea("BieuDo");
   Anh =  BieuDo.Drawings.Add(SpreadsheetDocumentDrawingType.Chart);
   Anh.Place(BieuDo.Area("R8C2:R43C77"));
   Anh.Line = New line(SpreadsheetDocumentDrawingLineType.None);
   LoBieuDo = Anh.Object;      
   
   Chart = LoBieuDo;
   Spreadsheet.Clear();
   BieuDo.Parameters.TenDonVi = TenDonVi;
   BieuDo.Parameters.DiaChi = DiaChi;
   BieuDo.Parameters.Ky = "Từ ngày " +  Format(TuNgay, "DF=dd/MM/yyyy") + " đến ngày " + Format(DenNgay, "DF=dd/MM/yyyy");

   Chart.RefreshEnabled = False;
   Chart.AutoTransposition = False;
   Chart.ValueLabelFormat = "ND=16; NG=3,0";
   Chart.PercentLabelFormat = "ND=16; NG=3,0";
   Chart.ChartType = KieuBieuDo;
   
   ChartPoint = Chart.SetPoint("Doanh số");
   ChartPoint.Text = "Doanh số";
   
   For Each Result In Object.ChiTiet Do
      CurrentChartSeries = Chart.SetSeries(Format(Result.Date,"DF=dd/MM/yyyy"));
      CurrentChartSeries.Text = Format(Result.Date,"DF=dd/MM/yyyy");
      Chart.SetValue(ChartPoint, CurrentChartSeries, Format(Result.DoanhSo,"ND=16; NG=3,0"));
   EndDo;
   
   Chart.Transparent = False;
   Chart.TitleArea.Text = "Ngày";
   Chart.TitleArea.TextColor = WebColors.Blue;
   Chart.TitleArea.BackColor = WebColors.White;
   Chart.PlotArea.BackColor =  WebColors.White;
   Chart.LegendArea.BackColor = WebColors.White;
    Chart.BackColor = WebColors.White;

   Chart.RefreshEnabled = True;
   Chart.AutoTransposition = True;
   
   Spreadsheet.Put(BieuDo);

EndProcedure

Thanks,
Cuong

 
#2
People who like this:0Yes/0No
Active user
Rating: 4
Joined: Apr 18, 2012
Company:

Hi, Nguyen Trung Cuong.

Most likely you have form attribute with name "Spreadsheet", so if you don't use it on the form, remove it. Or if it used, rename variable "Spreadsheet" in procedure "Print".

 
#3
People who like this:0Yes/0No
Active user
Rating: 2
Joined: Aug 10, 2012
Company: N/A

Hi Alexei Khatin,

Thank you very much for your help.
It solved my problem.

Sorry for late response
Cuong

 
Subscribe
Users browsing this topic (guests: 1, registered: 0, hidden: 0)
Be the first to know tips & tricks on business application development!

A confirmation e-mail has been sent to the e-mail address you provided .

Click the link in the e-mail to confirm and activate the subscription.