Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
73 views
Hi,
I have problem with sum column in telerik report
In attached my report with sum row and here my code to export this report to pdf:

        protected void Unnamed1_Click(object sender, EventArgs e) {
            // export to pdf
            if (TreeViewFilter.SelectedNodes.Count > 0) {
                int reportId = Convert.ToInt32(TreeViewFilter.SelectedValue);
                string fileName = string.Format("Report{0}.pdf", reportId);
                string fileNameGuid = string.Format("Report{0}{1}.pdf", reportId, Guid.NewGuid());
                string name = string.Format("{0}\\{1}", ConfigurationManager.AppSettings["ExportFolderPath"], fileName);
                if (File.Exists(name)) {
                    //Set the appropriate ContentType.
                    Response.ClearContent();
                    Response.ContentType = "Application/pdf";
                    Response.AddHeader("content-disposition", string.Format("attachment;filename={0}", fileNameGuid));
                    //Write the file directly to the HTTP content output stream.
                    Response.WriteFile(name);
                    Response.End();
                }
            }
        }

The problem is that i can see sum row in report preview but it does not appear in the exported file. Where the problem? Thanks.
Kvasov Dmitry
Top achievements
Rank 1
 answered on 20 Jun 2013
3 answers
133 views

Hi, I am trying to loop through all my panelsbars in JS but it does not work, when I try to getelementbyid then i can find the panel bat but not like this:
any ideas?

$('div[id*="P010101"]').each(function () {
    alert('a');
});

Thank you.
Gabriel
Top achievements
Rank 1
 answered on 19 Jun 2013
4 answers
289 views
Good day, team

It's possible to upload big file using Firefox & Chrome, everything is ok, but there is a problem with uploading a big document via IE8-9: file is getting truncated to 2048 Kbs. 

HttpPostedFile always has ContentLength ~2 Mbs in case of Internet Explorer and big documents.
ContentType is 'application/octet-stream' despite of different real content type (Firefox & Chrome maintain proper ContentType).

Additional details:
In case of IE we can see filled Request.Form["metadata"] with details: number of chunks, total file size, e.t.c
In case of Firefox/Chrome this metadata is null.
I suppose only the first chunk has loaded into file stream in case of IE.

I would like to ask about giving me a clue how to resolve this problem.





Plamen
Telerik team
 answered on 19 Jun 2013
7 answers
422 views
Hello I've the following problem:

I've a page, Default.aspx, which contains a placeholder for a dynamically loaded UserControl (#UC1). UC1 cotains a fixed programmed UserControl UC1A which contains a RadGrid with a LinkButton defined in the CommandItemTemplate. When clicking on the linkbutton I expect the OnRequestStarted will be called but the alert message in the script function never appears. It seems the postback is being cancelled.

So masterpage:
...
<head>
  ..
  
    <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
      <script type="text/javascript">
        function onRequestStart(sender, args) {
  
            alert(args.get_eventTarget());
  
            if (args.get_eventTarget().indexOf("ExportToExcelButton") >= 0 ||
            args.get_eventTarget().indexOf("ExportToCsvButton") >= 0 ||
            args.get_eventTarget().indexOf("ExportToPdfButton") >= 0) {
            args.set_enableAjax(false);
            }
        }
      </script>
    </telerik:RadCodeBlock>
  
    <asp:ContentPlaceHolder ID="HeadContent" runat="server">
    </asp:ContentPlaceHolder>
</head>
<body>
    <form runat="server">
    <telerik:RadScriptManager ID="RadScriptManager1" runat="server" />
    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
      <ClientEvents OnRequestStart="onRequestStart" />
    </telerik:RadAjaxManager>
   ....
    </form>
   ....
</body>

UC1A contains:

    <telerik:RadAjaxManagerProxy ID="RadAjaxManagerProxy1" runat="server">
      <AjaxSettings>
        <telerik:AjaxSetting AjaxControlID="rgRelation">
          <UpdatedControls>
            <telerik:AjaxUpdatedControl ControlID="rgRelation" />
          </UpdatedControls>
        </telerik:AjaxSetting>
      </AjaxSettings>
    </telerik:RadAjaxManagerProxy>
  
asp:Label ID="lblUCCRMTitle" runat="server" Text="Relation" CssClass="styleTitle"></asp:Label>
<asp:Panel ID="pnlRelation" runat="server" Width="100%" ScrollBars="auto">
<telerik:RadGrid ID="rgRelation" 
                 runat="server" 
                 AllowFilteringByColumn="True" 
                 AllowPaging="True" AllowSorting="True" 
                 AutoGenerateColumns="False" 
                 CellSpacing="0" 
                 DataSourceID="sqlDSRGRelation" 
                 GridLines="None" 
                 PageSize="20" 
                 Skin="Windows7"
                 OnItemCommand="rgRelation_ItemCommand" 
        onitemcreated="rgRelation_ItemCreated">
<ExportSettings ExportOnlyData="true" Excel-Format="ExcelML" >
  <Excel Format="ExcelML"></Excel>
</ExportSettings>
  
    <ClientSettings><Resizing ClipCellContentOnResize="false"/>
                                      
    </ClientSettings>
  
<MasterTableView DataKeyNames="RelationID" DataSourceID="sqlDSRGRelation" CommandItemDisplay="Bottom" InsertItemDisplay="Bottom">
            <CommandItemTemplate>
<div id="CommandItemTemplate">
<div id="CommandItemTemplateLeft">
    <asp:LinkButton ID="lbnAddRecord" runat="server" CssClass="CommandItemLinkButton" CommandName="InitInsert"></asp:LinkButton>
    <span class="CommandItemTemplateDivider">|</span>
    <asp:LinkButton ID="lbnExportToExcel" runat="server" CssClass="CommandItemLinkButton" CommandName="ExportToExcel"></asp:LinkButton>
    <asp:LinkButton ID="lbnExportToPDF" runat="server" CssClass="CommandItemLinkButton" CommandName="ExportToPdf"></asp:LinkButton>
    <asp:LinkButton ID="lbnExportToCSV" runat="server" CssClass="CommandItemLinkButton" CommandName="ExportToCsv"></asp:LinkButton>
    <span class="CommandItemTemplateDivider">|</span>
    <asp:LinkButton ID="lbnRefresh" runat="server" CssClass="CommandItemLinkButton" CommandName="RebindGrid"></asp:LinkButton>
    <span class="CommandItemTemplateDivider">|</span>
    <asp:LinkButton ID="lbnSaveGridLayout" runat="server" CssClass="CommandItemLinkButton" CommandName="SaveGridLayout"></asp:LinkButton>
</div>
</div>
</CommandItemTemplate>
<CommandItemSettings    ShowExportToPdfButton="true"
                        ExportToPdfText="Export to PDF" 
                        ShowExportToExcelButton="true"
                        ExportToExcelText="Export to Excel" 
                        ShowExportToCsvButton="true"
                        ExportToCsvText="Export to CSV" >
</CommandItemSettings>
  
..........


Qais
Top achievements
Rank 1
 answered on 19 Jun 2013
2 answers
52 views
Hello;

As an end user when visiting the web page the scrolling vertically of the page is not smooth. It flickers and jumps back.
When I open Fiddler or Firebug and look at the HTTP requests there is are constant  posts from the RadScriptManager about every second. I think this causes the scrolling issue.
I think the cause is a timer_tick for a clock that is causing the scrolling issue.
What are some ideas to resolve this issue and allow scrolling to work normally?

Thank you;
msigman
Top achievements
Rank 2
 answered on 19 Jun 2013
2 answers
72 views
Good afternoon,

When setting up the radEditor I can browse and upload html documents in the template manager and select them showing a preview on the right side. When I click the 'Insert' button however nothing happens. There are no javascript errors thrown. I have AllowSpecialTags="True" turned on. I pulled the control onto a blank aspx page and have the same issue. The Image Manager works just fine and insert places the image in the HTML content area. Anyone know why it would function this way?

Thanks,

David
David
Top achievements
Rank 1
 answered on 19 Jun 2013
1 answer
711 views
I'm creating some Radcharts programmatically (no aspx file...it's a web part).

I set Appearance.Dimensions.Height.Value (and .Width), and tried setting Appearance.Dimensions.AutoSize to false.

The chart image is properly sized, but the generated HTML contains this:
<div id="ctl00_ctl23_g_2c6dbf0b_0bfd_497c_aa14_bf4418896fcd_AverageChart" class="RadChart" style="height:300px;width:400px;">
    <img alt="" style="border-width: 0px;" ...
</div>

Where does the style with default height and width in the div element come from?  I add two charts to the page (using Controls.Add(averageChart); ) and they overlay each other because the html doesn't use the correct height.

ASP.NET AJAX 2013 Q2
.NET 3.5 Windows 2008 R2

Thanks,
Randy Lindsey
Randy
Top achievements
Rank 1
 answered on 19 Jun 2013
15 answers
391 views
Hi,

First of all, I want to thank you for producing such a great product like RadScheduler.

Anyway, after I have purchased and try a bit more with it in my current project, I got 2 issues which need your kindly helps/hints to sort it out.

The 1st one is that I got a script error message everytime my mouse cursor hover over any appointment which you can see in the first attachment. (I have implemented a custom provider and post the code below)

The 2nd one is that the resource header row is not well aligned correctly with the appointment area which you can see in the second attachment.

Please suggest.

Here is my custom provider code.
using System; 
using System.Collections.Generic; 
using System.Linq; 
using System.Text; 
using AIAPS.DomainModel.Entities; 
using AIAPS.DomainModel.Repositories; 
using Telerik.Web.UI; 
 
namespace AIAPS.DomainModel.Utilities 
    public class ApsSchedulerProvider : SchedulerProviderBase 
    { 
        private List<Resource> _resources; 
 
        private void LoadResources() 
        { 
            _resources = new List<Resource>(); 
 
            Resource res = new Resource("Machine", "M-001", "M-001"); 
            _resources.Add(res); 
            res = new Resource("Machine", "M-002", "M-002"); 
            _resources.Add(res); 
            res = new Resource("Machine", "M-003", "M-003"); 
            _resources.Add(res); 
            res = new Resource("Machine", "M-004", "M-004"); 
            _resources.Add(res); 
            res = new Resource("Machine", "P-001", "P-001"); 
            _resources.Add(res); 
            res = new Resource("Machine", "P-002", "P-002"); 
            _resources.Add(res); 
        } 
 
        public ApsSchedulerProvider() 
        { 
            LoadResources(); 
        } 
 
        public override void Delete(RadScheduler owner, Appointment appointmentToDelete) 
        { 
            throw new NotImplementedException(); 
        } 
 
        public override IEnumerable<Appointment> GetAppointments(RadScheduler owner) 
        { 
            //throw new NotImplementedException(); 
            List<Appointment> appointments = new List<Appointment>(); 
            foreach (ApsProcessTimeline timeline in ApsProcessTimelinesRepository.List.OrderBy(t => t.BeginTime)) 
            { 
                Appointment app = new Appointment(); 
                app.ID = timeline.ApsProcessTimelineId; 
                app.Start = timeline.BeginTime.Value; 
                app.End = timeline.FinishTime.Value; 
                app.Description = timeline.MachineID; 
                app.Subject = timeline.MachineID; 
                app.Resources.Add(new Resource("Machine", timeline.MachineID, timeline.MachineID)); 
                appointments.Add(app); 
            } 
 
            owner.TimelineView.ShowResourceHeaders = true
            owner.TimelineView.GroupBy = "Machine"
            owner.TimelineView.GroupingDirection = GroupingDirection.Vertical; 
            //owner.TimelineView.NumberOfSlots = appointments.Count; 
            owner.TimelineView.HeaderDateFormat = "dd/MM/yy"
             
            owner.SelectedDate = appointments[0].Start; 
 
            return appointments; 
        } 
 
        public override IEnumerable<ResourceType> GetResourceTypes(RadScheduler owner) 
        { 
            //throw new NotImplementedException(); 
            List<ResourceType> resourceTypes = new List<ResourceType>(); 
            resourceTypes.Add(new ResourceType("Machine")); 
            return resourceTypes; 
        } 
 
        public override IEnumerable<Resource> GetResourcesByType(RadScheduler owner, string resourceType) 
        { 
            //throw new NotImplementedException(); 
            return _resources.FindAll(delegate(Resource res) { return res.Type == resourceType; }); 
        } 
 
        public override void Insert(RadScheduler owner, Appointment appointmentToInsert) 
        { 
            throw new NotImplementedException(); 
        } 
 
        public override void Update(RadScheduler owner, Appointment appointmentToUpdate) 
        { 
            throw new NotImplementedException(); 
        } 
    } 
 

*Note that currently I have only one type of resource which is "Machine" and it is being stored on "MachineID" field.

I am looking forward for your suggestion.

Thank you and best regards,
Seree W.
Carl
Top achievements
Rank 1
 answered on 19 Jun 2013
1 answer
212 views
Hi,

Im using the following pie chart mark:

<telerik:RadHtmlChart ID="rhcGraficoResumoLeitos" SkinsOverrideStyles="true" runat="server" Width="350px" Height="300px">
                                        <ChartTitle Text="Ocupação dos leitos">
                                        </ChartTitle>
                                        <PlotArea>
                                            <Series>
                                                <telerik:PieSeries DataFieldY="Quantidade" ColorField="Cor" NameField="Situação" ExplodeField="IsExploded">
                                                    <LabelsAppearance DataFormatString="{0:N0}">
                                                    </LabelsAppearance>
                                                </telerik:PieSeries>
                                            </Series>
                                        </PlotArea>
                                    </telerik:RadHtmlChart>

And code behind:

private void CarregarResumoLeitos()
        {
            rhcGraficoResumoLeitos.DataSource = GetData();
            rhcGraficoResumoLeitos.DataBind();
        }
 
        private DataSet GetData()
        {
            ControladorInternacao controladorInternacao = new ControladorInternacao();
            List<SalaAtendimentoDTO> listaSalaAtendimento = controladorInternacao.ListarResumoLeitos(AmbienteConexao.Usuario().Cnes);
 
            Color[] barColors = new Color[8]{
               Color.Purple,
               Color.SteelBlue,
               Color.Aqua,
               Color.Yellow,
               Color.Navy,
               Color.Green,
               Color.Blue,
               Color.Red
           };
 
            DataSet ds = new DataSet("Estabelecimento");
            DataTable dt = new DataTable("SalaAtendimento");
 
            dt.Columns.Add("Gênero");
            dt.Columns.Add("Situação");
            dt.Columns.Add("Quantidade");
            dt.Columns.Add("Cor");
            dt.Columns.Add("IsExploded");
 
            int i = 0;
            foreach (SalaAtendimentoDTO salaAtendimentoDTO in listaSalaAtendimento)
            {
                dt.Rows.Add(salaAtendimentoDTO.Genero == string.Empty ? "teste" : salaAtendimentoDTO.Genero, salaAtendimentoDTO.SituacaoSala, salaAtendimentoDTO.Quantidade.ToString(), barColors[i++], true);
            }
 
            ds.Tables.Add(dt);
            return ds;
        }
 
        private static Color CorAleatoria()
        {
            Random randonGen = new Random();
            KnownColor[] names = (KnownColor[]) Enum.GetValues(typeof(KnownColor));
            KnownColor randomColorName = names[randonGen.Next(names.Length)];
            Color randomColor = Color.FromKnownColor(randomColorName);
            return randomColor;
        }


But im not able to color each item in the pie chart.

Can anyone help me please ?

Thanks in advance.
Danail Vasilev
Telerik team
 answered on 19 Jun 2013
2 answers
82 views
Ok,

I'm getting a javascript error any time a RadSearchBox is contained within any element that has a display:none style set to it.

As an example, let's say you want to put a RadSearchBox inside a user control which is inside a RadPanelBar.

Each one of the below user controls contains a RadSearchBox.
<telerik:RadPanelBar ID="RadPanelBar1" runat="server">
  <Items>
      <telerik:RadPanelItem Text="Launch a Something" runat="server">                       
         <ContentTemplate>
            <CRWP:ucLaunchSomething id="ucLaunchSomethingCtl" runat="server"></CRWP:ucLaunchSomething>
          </ContentTemplate>
      </telerik:RadPanelItem>
      <telerik:RadPanelItem runat="server" Text="Launch a Something Else">                       
         <ContentTemplate>
            <CRWP:ucLaunchSomethingElse id="ucLaunchSomethingElseCtl" runat="server"></CRWP:ucLaunchSomethingElse>
         </ContentTemplate>
      </telerik:RadPanelItem>
   </Items>
</telerik:RadPanelBar>

When the above is rendered (in at least IE9), it throws a javascript error in the following line:

z.style.width=(y-(x+w+v+6))+"px";


One of the problems is that y == 0 at this point so it's trying to set the width to a negative number. JavaScript error in IE JavaScript Console is SCRIPT:87 Invalid argument.

Any suggestions on how to make it work without throwing the javascript error would be greatly appreciated.

Thanks



Ben
Top achievements
Rank 1
 answered on 19 Jun 2013
Narrow your results
Selected tags
Tags
+? more
Top users last month
Ambisoft
Top achievements
Rank 2
Iron
Pascal
Top achievements
Rank 2
Iron
Matthew
Top achievements
Rank 1
Sergii
Top achievements
Rank 1
Iron
Iron
Andrey
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Ambisoft
Top achievements
Rank 2
Iron
Pascal
Top achievements
Rank 2
Iron
Matthew
Top achievements
Rank 1
Sergii
Top achievements
Rank 1
Iron
Iron
Andrey
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?