I have graph in my page, build with the help of jqplot. And the graph lies within the update panel.Now I need to export that graph to the excel. But while I export that graph only the Title get exported but not the graph.So, I am stuck on this.
I will be very thankful to the answer for exporting the chart build by jqplot within the update panel to excel
Code used for export:
protected void btnExcel_Click(object sender, ImageClickEventArgs e)
{
Response.Clear();
Response.AddHeader("content-disposition", "attachment;filename=ProjectTarget_" + CampaignID + ".xls");
Response.Charset = "";
Response.ContentType = "application/vnd.xls";
StringWriter stringWrite = new StringWriter();
HtmlTextWriter htmlWrite = new HtmlTextWriter(stringWrite);
// LoadMileStones(currMileStone);
TableLists.RenderControl(htmlWrite);
Response.Write(stringWrite.ToString());
Response.End();
}
Related
I am new at Devexpress and need help
I am exporting to pdf but pdf colums not good need to autosize
how can I with code ?
here is my codes
private void navBarPdf_ElementClick(object sender, NavElementEventArgs e)
{
var save = new SaveFileDialog();
if (save.ShowDialog() == DialogResult.OK)
{
gridView1.ExportToPdf(save.FileName + ".pdf");
}
}
just right click on the header of your gridview and click BestFit(all columns) and the export your pdf
this works for me
Best
Here's what I am currently doing in C#:
TapGestureRecognizer tap = new TapGestureRecognizer()
{
NumberOfTapsRequired = 1
};
tap.SetBinding(TapGestureRecognizer.CommandProperty, new Binding("DeckTapCommandAsync", source: GD));
tap.SetBinding(TapGestureRecognizer.CommandParameterProperty, new Binding("TapCommandParam", source: GD));
GestureRecognizers.Add(tap);
What I would like to know is if there is any way I can do this using Xamarin.Forms C# markup
https://learn.microsoft.com/en-us/xamarin/xamarin-forms/user-interface/csharp-markup
Yes, you could use SetBinding for TapGestureRecognizer.
Using ICommand:
var tapGestureRecognizer = new TapGestureRecognizer();
tapGestureRecognizer.SetBinding (TapGestureRecognizer.CommandProperty, "TapCommand");
image.GestureRecognizers.Add(tapGestureRecognizer);
For more details, you could check the link: https://learn.microsoft.com/en-us/xamarin/xamarin-forms/app-fundamentals/gestures/tap#using-icommand
You could download the source file from the link: https://learn.microsoft.com/en-us/samples/xamarin/xamarin-forms-samples/workingwithgestures-tapgesture/
Or you could set with below:
// Image TRASH
TapGestureRecognizer tgrTrash = new TapGestureRecognizer();
tgrTrash.SetBinding(TapGestureRecognizer.CommandProperty, new Binding("BindingContext.TrashCommand", source: this));
tgrTrash.SetBinding(TapGestureRecognizer.CommandParameterProperty, ".");
Image imageTrash = new Image() { Source = "trash.png" };
//Label lTrash = new Label { Text = "Trash", VerticalTextAlignment = TextAlignment.Center };
imageTrash.GestureRecognizers.Add(tgrTrash);
You could download the source file from the link: https://github.com/WendyZang/TestBindingWithListView
Trying to tap into iText7 potential, that is in there, but hidden from the developer. I want my text in columns to flow around images that will be placed on page-level (fixed position). Either I'm doing something wrong, or there is a bug in the code. Here is what I have so far:
open Document for writing
set document renderer to custom ColumnDocumentRenderer:
Class<RootRenderer> cls = RootRenderer.class;
final Field f = cls.getDeclaredField("floatRendererAreas");
f.setAccessible(true);
ColumnDocumentRenderer cdr = new ColumnDocumentRenderer(document, new Rectangle[]{
new Rectangle(36f, 36f, 243.5f, 770f),
new Rectangle(315.5f, 36f, 243.5f, 770f)
}) {
#Override
protected LayoutArea updateCurrentArea(LayoutResult overflowResult) {
LayoutArea lr = super.updateCurrentArea(overflowResult);
try {
List<Rectangle> list = (List<Rectangle>) f.get(this);
list.add(new Rectangle(130f, 230f, 350f, 200f));
} catch (Exception ex) {
throw new RuntimeException(ex);
}
return lr;
}
};
document.setRenderer(cdr);
This custom renderer adds the rectangle in which I will later place an image to floatRendererAreas field, so that the renderers will know which area to avoid.
add my content:
Div div = new Div();
div.setBackgroundColor(ColorConstants.BLUE);
div.setMargins(0f, 0f, 0f, 0f);
div.setPaddings(0f, 0f, 0f, 0f);
div.setFixedPosition(130f, 230f, 350f);
div.setHeight(200f);
document.add(div);
for (int i = 0; i < 6; i++) {
Paragraph p = new Paragraph();
p.add("Lorem ipsum...");
document.add(p);
}
unfortunately I get this:
edit: the layouting code is aware of the forbidden area, it just detects it too late, so up to one line is rendered in a wrong way. With y set to 260:
Probably it looks that the top of the text line is not affected, whereas it should check whether bottom of the text line is not affected as well.
What am I doing wrong? Is there another method to do it? Why is this not part of public/protected API? It could be extremely useful when creating documents.
I'm working in JavaFX with PDFbox and I have this problem. I want to scroll Scroll through the pages of a pdf by clicking a button(when I press it I want to go to the next page). When I open the pdf then I show the first page with this code:
BufferedImage bi = new BufferedImage (500,500,BufferedImage.TYPE_INT_RGB);
Image img = SwingFXUtils.toFXImage(bi, null);
BufferedImage firstpage = new BufferedImage (500,500,BufferedImage.TYPE_INT_RGB);
firstpage = pdPages.get(0).convertToImage(BufferedImage.TYPE_INT_RGB, 100);
Image primapagina = SwingFXUtils.toFXImage(firstpage, null);
ImageView v ;
v = new ImageView(primapagina);
Then I created a button like this:
Button avanti = new Button(">>");
avanti.setStyle("-fx-font: 22 arial;");
Finally I created the handler,
avanti.setOnAction(new EventHandler<ActionEvent>() {
#Override public void handle(ActionEvent e) {
// final int j = i;
BufferedImage Xpage = null;
try {
Xpage = pdPages.get(8).convertToImage(BufferedImage.TYPE_INT_RGB, 100);
// System.out.printf("\n firstpage %d",t );
} catch (IOException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
Image Xpagina = SwingFXUtils.toFXImage(Xpage, null);
v.setImage(Xpagina);
}
});
At the moment I put 8 just to see if it was working, and it was. But How can I ,by clicking the button, go to the next page? I thought about pointers, but I don't think it exist in JavaFX.
Thanks
I have a Mango WP7.5 app that uses a local SqlCe database. I would like to add a LiveTile update that shows info taken from the local DB based on current day and month.
All the samples that I've found update the background by downloading remote images from servers but I would simply need to make a local database query and show a string in my tile.
Can I do it? How?
Yes, you can. You have to
generate an image containing your textual information
save this image to isolated storage and
access it via isostore URI.
Here is code showing how to do this (it updates the Application Tile):
// set properties of the Application Tile
private void button1_Click(object sender, RoutedEventArgs e)
{
// Application Tile is always the first Tile, even if it is not pinned to Start
ShellTile TileToFind = ShellTile.ActiveTiles.First();
// Application Tile should always be found
if (TileToFind != null)
{
// create bitmap to write text to
WriteableBitmap wbmp = new WriteableBitmap(173, 173);
TextBlock text = new TextBlock() { FontSize = (double)Resources["PhoneFontSizeExtraLarge"], Foreground = new SolidColorBrush(Colors.White) };
// your text from database goes here:
text.Text = "Hello\nWorld";
wbmp.Render(text, new TranslateTransform() { Y = 20 });
wbmp.Invalidate();
// save image to isolated storage
using (IsolatedStorageFile isf = IsolatedStorageFile.GetUserStoreForApplication())
{
// use of "/Shared/ShellContent/" folder is mandatory!
using (IsolatedStorageFileStream imageStream = new IsolatedStorageFileStream("/Shared/ShellContent/MyImage.jpg", System.IO.FileMode.Create, isf))
{
wbmp.SaveJpeg(imageStream, wbmp.PixelWidth, wbmp.PixelHeight, 0, 100);
}
}
StandardTileData NewTileData = new StandardTileData
{
Title = "Title",
// reference saved image via isostore URI
BackgroundImage = new Uri("isostore:/Shared/ShellContent/MyImage.jpg", UriKind.Absolute),
};
// update the Application Tile
TileToFind.Update(NewTileData);
}
}