Export to PDF of Calendar that has had its Appointments customized

8 posts, 0 answers
  1. Brent Hetland
    Brent Hetland avatar
    61 posts
    Member since:
    Aug 2009

    Posted 21 Sep 2015 Link to this post

    Hi,

    I use version 2015.01.401 of your controls.

    In the RadScheduler_AppointmentCreated Event, I customize the subject of the Appointment with the code below:

     

    AppointmentLinkButton.Text = String.Concat(e.Appointment.Subject, " - <i>(", DivisionName, " - ", OwnerName, ")</i>")

    Dim emEventID As String = e.Appointment.Attributes("emEventID")

    AppointmentLinkButton.PostBackUrl = EMLink.Url((Cbs.Data.SD.NavTreeObjectTypes.EventDetails).ToString(), emEventID)

    Dim tooltipValueParam As String = String.Concat(emEventID, PIPE_DELIMETER, SessUserCultureCode, PIPE_DELIMETER, SessUserID)

    Dim jscript As String = "javascript:showProjectToolTip(this,'" & tooltipValueParam & "');"

    Dim jscriptClearTimer As String = "javascript:clearTimeout(timer1);"

    ImagesLiteralControl.Text = String.Format(APPTSUBJECTIMAGESTRING_CONST, "../../img/icons/event-bricks_small.png", jscript, jscriptClearTimer) ​

    e.Appointment.BackColor = System.Drawing.ColorTranslator.FromHtml(e.Appointment.Attributes("DivisionChartHexColor"))

    AppointmentLinkButton.ForeColor = GetIdealTextColor(e.Appointment.BackColor)

     

    You can also see that I have code in that event that sets the background color of the appointments, based on user configurable colors stored in our database (they are not in CSS files).  I've attached the SchedulerInWebApp.png file to show you what it looks like in the web app.  The image that is there, uses a radtooltip manager to call a web service to display more information.  And the actual text is a link to the item in our system.

    My problem is that when I do an export to PDF, the image isn't found and the subject contains no text.  I've attached the SchedulerPDFOutput.png to show that.

    Question:  How can I get the Export to NOT try to embed the image, and have it just display the custom text that I am creating?

    Thanks in Advance,

    Brent

  2. Plamen
    Admin
    Plamen avatar
    2731 posts

    Posted 24 Sep 2015 Link to this post

    Hello,

    In such cases we recommend using custom style sheet file to the export so that the custom styles are applied there too.

    Hope this will help you solve the issue.

    Regards,
    Plamen
    Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Brent Hetland
    Brent Hetland avatar
    61 posts
    Member since:
    Aug 2009

    Posted 25 Sep 2015 in reply to Plamen Link to this post

    Hi Plamen,

    No, that does not solve my issue.  Can someone please read my original post again?

    I customize the Appointment's using a template, during AppointmentCreated.  When I export, I want to appointments to retain the new subject and background color I give them.  They currently retain the color, but the control's (a link button) text is not displayed.

    If you have questions as to what I'm doing or what problem I'm having, please ask me to clarify.  Don't just post a generic response, hoping that it answers my question.

    Thanks,

    Brent

  5. Plamen
    Admin
    Plamen avatar
    2731 posts

    Posted 25 Sep 2015 Link to this post

    Hi Brent,

    In this case we when you need you export an image in the template we recommend using some CSS class and add the background -image from the CSS as for example it is done in the attached page.

    Regards,
    Plamen
    Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  6. Brent Hetland
    Brent Hetland avatar
    61 posts
    Member since:
    Aug 2009

    Posted 25 Sep 2015 in reply to Plamen Link to this post

    Hi Plamen,

    You are still not understanding.  I do NOT want to export the image.  I only want to display the image in the web page, which I am not having a problem with.

    Look at the pictures I attached.  My main problem is:

    1)  I use a template that has an image.  When I export, I don't want to display the image.

    2)  I DO still want to show the label from my template, which shows a modified version of the appointment's subject.

    Perhaps one of your co-workers can read my thread and better understand.

    I'm not trying to be rude, but you aren't understanding and this "back and forth" is just costing time for both of us, without answering the question.

    Thanks,
    Brent

  7. Plamen
    Admin
    Plamen avatar
    2731 posts

    Posted 28 Sep 2015 Link to this post

    Hi,

    If you want to only view the image in the web page and not in the PDF you can use the same approach by setting the image with a css class and CSS rule but without using the CSS file in the StyleSheets PDF setting. This way the style will not be applied and the image will not be seen.

    Regards,
    Plamen
    Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  8. Brent Hetland
    Brent Hetland avatar
    61 posts
    Member since:
    Aug 2009

    Posted 28 Sep 2015 in reply to Plamen Link to this post

    But in code, how do I tell I am exporting versus posting back to the page?  I'd need to know that in order to NOT display the image when exporting.

    And you still haven't answered my question as to why my custom appointment subject is not appearing.

    With regards to your answers on this forum post, I must say that this is the most frustrating forum post I've ever had.  I'd say that 99% of the time I've asked a question in Telerik's forums, I'm very satisfied with the answers I get.  In this case, I'm frustrated with the lack of understanding and very incomplete answers.

  9. Plamen
    Admin
    Plamen avatar
    2731 posts

    Posted 01 Oct 2015 Link to this post

    Hello,

    It seems that I could not explain correctly - please excuse me for that. The suggested approach for this case is to associate the controls inside the template with a CSS class as in the attached project and assign the image for them in the CSS style for this class. This way when yo export to PDF the images they will not be seen and you will not have to differentiate between different postbacks. Yet it you do not include  StyleSheets PDF setting they will not be applied on the PDF

    The images will only be seen in the web page and the updated text of the appointment  will be seen too.

    Hope this will help you solve the issue. 

    Regards,
    Plamen
    Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017