How to replace a old text with the new text in powerpoint presentation
using openxml
i am new to Openxml. i have a requirement that i need to replace occurence
of texts in powerpoint presentation with new text. am opening the already
created ppt file. For Example i have 30 slides and in some of the slides i
have <> text, i need to replace <> with orginal customer name which am
getting from web page. it should replace all the occurence of the <> with
the new text. How do i replace it ?
My code :
sPptPath = Server.MapPath("~/Source/PPT/") +
DdSubSolutions.SelectedItem.Text.Trim().ToString() + ".pptx";
var pkg = Package.Open(sPptPath, FileMode.Open, FileAccess.ReadWrite);
// Specify the URI of the part to be read
var uri = new Uri("/ppt/presentation.xml",
UriKind.Relative);
PackagePart part = pkg.GetPart(uri);
var xmlMainXmlDoc = new XmlDocument();
xmlMainXmlDoc.Load(part.GetStream(FileMode.Open,
FileAccess.Read));
xmlMainXmlDoc.InnerXml =
xmlMainXmlDoc.InnerXml.Replace("cust", "banu");
// Open the stream to write document
var partWrt = new
StreamWriter(part.GetStream(FileMode.Open,
FileAccess.Write));
xmlMainXmlDoc.Save(partWrt);
partWrt.Flush();
partWrt.Close();
pkg.Close();
am getting invalid operation exception in the below line var uri = new
Uri("/ppt/presentation.xml", UriKind.Relative);
Thanks, Banu
Bolejack
Thursday, 3 October 2013
Wednesday, 2 October 2013
How to install Web Platform Installer on remote Windows Server 2012 R2 in Core mode?
How to install Web Platform Installer on remote Windows Server 2012 R2 in
Core mode?
Because of a Core installation mode I can't login remotely and setup it
from installer.
Is there any other way?
Then I could connect to this web server using remote management and
install software from it:
Core mode?
Because of a Core installation mode I can't login remotely and setup it
from installer.
Is there any other way?
Then I could connect to this web server using remote management and
install software from it:
Remove Text from a String in an SSIS Package
Remove Text from a String in an SSIS Package
I am currently updating an already existing SSIS package. The current
Package pulls data from an Excel Spread Sheet that is provided by our IT
Department. It lists Machine Names of Computers and counts it for a
License Report.
I currently have the Job (derived column) strip off the M (Mobile) or D
(Desktop) from the first part of the machine name so that it returns just
the user name, which is what I need for the report.
MBRUBAKERBR => BRUBAKERBR
However, our IT Department just implemented Windows 7 and with it a new
Naming convention. Now there is a 76A, B, C or D that is added to the end
of all of the updated machines. If the machine has not been updated then
it stays with the older Naming Convention (seen Above).
There are also machines that have to stay on XP, their names have been
update to have X3A, B, C or D at the end of theirs.
MBRUBAKERBR76A or DBRUBAKERX3C
What I need is to remove the last part of the name so that I just get the
user name out of it for reporting.
The issues is I can't use a LEFT, RIGHT, LTRIM or RTRIM expression as some
of the computer names will only have the M or D in front (as they have not
yet been upgraded).
What can I do to remove these characters without rebuilding this package?
I am currently updating an already existing SSIS package. The current
Package pulls data from an Excel Spread Sheet that is provided by our IT
Department. It lists Machine Names of Computers and counts it for a
License Report.
I currently have the Job (derived column) strip off the M (Mobile) or D
(Desktop) from the first part of the machine name so that it returns just
the user name, which is what I need for the report.
MBRUBAKERBR => BRUBAKERBR
However, our IT Department just implemented Windows 7 and with it a new
Naming convention. Now there is a 76A, B, C or D that is added to the end
of all of the updated machines. If the machine has not been updated then
it stays with the older Naming Convention (seen Above).
There are also machines that have to stay on XP, their names have been
update to have X3A, B, C or D at the end of theirs.
MBRUBAKERBR76A or DBRUBAKERX3C
What I need is to remove the last part of the name so that I just get the
user name out of it for reporting.
The issues is I can't use a LEFT, RIGHT, LTRIM or RTRIM expression as some
of the computer names will only have the M or D in front (as they have not
yet been upgraded).
What can I do to remove these characters without rebuilding this package?
How nodejs based on videochat works
How nodejs based on videochat works
I'm trying to develop a webcam video chat using nodejs, so I have got one
computer capturing the webcam on a video tag, mounting every frame on a
canvas, catching the image from the canvas and sending this image via
socket, another person connected to the socket recieves the image and
mounts it on a img tag.
I don't know how node js works, so I would like to know if the server of
node js is transporting all the traffic or it is sended directly to the
client?
thanks
I'm trying to develop a webcam video chat using nodejs, so I have got one
computer capturing the webcam on a video tag, mounting every frame on a
canvas, catching the image from the canvas and sending this image via
socket, another person connected to the socket recieves the image and
mounts it on a img tag.
I don't know how node js works, so I would like to know if the server of
node js is transporting all the traffic or it is sended directly to the
client?
thanks
Tuesday, 1 October 2013
Perform Method on Main Thread Issue
Perform Method on Main Thread Issue
Hi I am trying to call a method from another subclass and it is working
but not being displayed on the main screen. The log shows that the method
is working but more than likely on a new instance of my controller.
Here is the method in my ViewController Class
//.h
{
- (void)updateCells;
}
//.m
- (void)updateCells
{
//Code in here
}
And in the method from another subclass that calls the method:
ViewController *viewController = [[ViewController alloc] init];
dispatch_async(dispatch_get_main_queue(), ^{
[viewController updateCells];
});
I tried the dispatch_async to have it perform the updateCells on the
screen but the method is called and nothing inside it is displayed. Should
I not create a new viewController instance and if so what should I do
instead? Thanks I am new to how calling methods from different classes
works.
Hi I am trying to call a method from another subclass and it is working
but not being displayed on the main screen. The log shows that the method
is working but more than likely on a new instance of my controller.
Here is the method in my ViewController Class
//.h
{
- (void)updateCells;
}
//.m
- (void)updateCells
{
//Code in here
}
And in the method from another subclass that calls the method:
ViewController *viewController = [[ViewController alloc] init];
dispatch_async(dispatch_get_main_queue(), ^{
[viewController updateCells];
});
I tried the dispatch_async to have it perform the updateCells on the
screen but the method is called and nothing inside it is displayed. Should
I not create a new viewController instance and if so what should I do
instead? Thanks I am new to how calling methods from different classes
works.
Unable to get connection, DataSource invalid - Netbeans, MySQL
Unable to get connection, DataSource invalid - Netbeans, MySQL
I'm following the tutorial of Netbeans site:
https://netbeans.org/kb/docs/web/mysql-webapp.html
everything was working fine until this step: Implementing JSTL code STEP 4
where the list should be displayed I get the following error:
javax.servlet.ServletException: javax.servlet.jsp.JspException:
Unable to get connection, DataSource invalid: "java.sql.SQLException:
Error in allocating a connection. Cause: Connection could not be allocated
because: java.net.ConnectException : Error connecting to server localhost
on port 1527 with message Connection refused."
root cause
javax.servlet.jsp.JspException: Unable to get connection, DataSource
invalid: "java.sql.SQLException: Error in allocating a connection. Cause:
Connection could not be allocated because: java.net.ConnectException :
Error connecting to server localhost on port 1527 with message
Connection refused."
note The full stack traces of the exception and its root causes are
available in the GlassFish Server Open Source Edition 4.0 logs.
I suppose netbeans still tries to connect to the Derby DB. How can i
change it to MySQL DB? I am using Java EE7, MySQL, Netbeans, Glassfish 7
I'm following the tutorial of Netbeans site:
https://netbeans.org/kb/docs/web/mysql-webapp.html
everything was working fine until this step: Implementing JSTL code STEP 4
where the list should be displayed I get the following error:
javax.servlet.ServletException: javax.servlet.jsp.JspException:
Unable to get connection, DataSource invalid: "java.sql.SQLException:
Error in allocating a connection. Cause: Connection could not be allocated
because: java.net.ConnectException : Error connecting to server localhost
on port 1527 with message Connection refused."
root cause
javax.servlet.jsp.JspException: Unable to get connection, DataSource
invalid: "java.sql.SQLException: Error in allocating a connection. Cause:
Connection could not be allocated because: java.net.ConnectException :
Error connecting to server localhost on port 1527 with message
Connection refused."
note The full stack traces of the exception and its root causes are
available in the GlassFish Server Open Source Edition 4.0 logs.
I suppose netbeans still tries to connect to the Derby DB. How can i
change it to MySQL DB? I am using Java EE7, MySQL, Netbeans, Glassfish 7
Partition resize after ubuntu on windows8
Partition resize after ubuntu on windows8
pI have got a weird problem and I ended up getting 3 partitions after
installing ubuntu on windows 8./p pIn sequence: 1. windows 8 - main
partition 2. Grub - 1 MB 3. ubuntu - 38 GB + Swap (5 GB) 4. 20 GB
partition which I had partitioned before installing ubuntu thinking that I
will install ubuntu on this partition/p p(The ubuntu 13.04 got installed
on original C:\ drive itself and took out 38.12 GB.)/p pHere is my prob: I
want to move 20 GB partition to C drive and make total size of ubuntu as
20 GB instead of current 38 GB. /p
pI have got a weird problem and I ended up getting 3 partitions after
installing ubuntu on windows 8./p pIn sequence: 1. windows 8 - main
partition 2. Grub - 1 MB 3. ubuntu - 38 GB + Swap (5 GB) 4. 20 GB
partition which I had partitioned before installing ubuntu thinking that I
will install ubuntu on this partition/p p(The ubuntu 13.04 got installed
on original C:\ drive itself and took out 38.12 GB.)/p pHere is my prob: I
want to move 20 GB partition to C drive and make total size of ubuntu as
20 GB instead of current 38 GB. /p
Subscribe to:
Comments (Atom)